Question: Match the descriptions on the left with the correct methods or attributes on the right from the sys and os modules. 1. determines what operating

Match the descriptions on the left with the correct methods or attributes on the right from the sys and os modules.

1. determines what operating system is being used where the Python program is running

[ Choose ] import os os.getcwd( ) os.path.isfile(path) os.rmdir(path) import sys sys.platform os.path.abspath(path) os.path.join os.path.exists(path) os.chdir(path) os.listdir( ) os.mkdir(path) os.rename(src, dst) os.path.isdir(path)

2. returns a string containing the current working directory path

[ Choose ] import os os.getcwd( ) os.path.isfile(path) os.rmdir(path) import sys sys.platform os.path.abspath(path) os.path.join os.path.exists(path) os.chdir(path) os.listdir( ) os.mkdir(path) os.rename(src, dst) os.path.isdir(path)

3. changes the current working directory to path

[ Choose ] import os os.getcwd( ) os.path.isfile(path) os.rmdir(path) import sys sys.platform os.path.abspath(path) os.path.join os.path.exists(path) os.chdir(path) os.listdir( ) os.mkdir(path) os.rename(src, dst) os.path.isdir(path)

4. returns a list of the files and directories in the current working directory

[ Choose ] import os os.getcwd( ) os.path.isfile(path) os.rmdir(path) import sys sys.platform os.path.abspath(path) os.path.join os.path.exists(path) os.chdir(path) os.listdir( ) os.mkdir(path) os.rename(src, dst) os.path.isdir(path)

5. creates a new directory at path

[ Choose ] import os os.getcwd( ) os.path.isfile(path) os.rmdir(path) import sys sys.platform os.path.abspath(path) os.path.join os.path.exists(path) os.chdir(path) os.listdir( ) os.mkdir(path) os.rename(src, dst) os.path.isdir(path)

6. deletes the directory at path if it is empty

[ Choose ] import os os.getcwd( ) os.path.isfile(path) os.rmdir(path) import sys sys.platform os.path.abspath(path) os.path.join os.path.exists(path) os.chdir(path) os.listdir( ) os.mkdir(path) os.rename(src, dst) os.path.isdir(path)

7. renames the file or directory in src to the file or directory in dst

[ Choose ] import os os.getcwd( ) os.path.isfile(path) os.rmdir(path) import sys sys.platform os.path.abspath(path) os.path.join os.path.exists(path) os.chdir(path) os.listdir( ) os.mkdir(path) os.rename(src, dst) os.path.isdir(path)

8. convert a relative path into an absolute path

[ Choose ] import os os.getcwd( ) os.path.isfile(path) os.rmdir(path) import sys sys.platform os.path.abspath(path) os.path.join os.path.exists(path) os.chdir(path) os.listdir( ) os.mkdir(path) os.rename(src, dst) os.path.isdir(path)

9. returns True if path refers to an existing file

[ Choose ] import os os.getcwd( ) os.path.isfile(path) os.rmdir(path) import sys sys.platform os.path.abspath(path) os.path.join os.path.exists(path) os.chdir(path) os.listdir( ) os.mkdir(path) os.rename(src, dst) os.path.isdir(path)

10. returns True if path refers to an existing directory

[ Choose ] import os os.getcwd( ) os.path.isfile(path) os.rmdir(path) import sys sys.platform os.path.abspath(path) os.path.join os.path.exists(path) os.chdir(path) os.listdir( ) os.mkdir(path) os.rename(src, dst) os.path.isdir(path)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!