menu

Python Input and Output

Python Input and Output - Important Points


11. Which symbol is used for the newline character in Python?

A. \n

B. \t

C. \r

D. \s

Discuss Work Space

Answer: option a

Explanation:

The \n symbol is used for the newline character in Python.

12. Which method is used to check if a file exists in Python?

A. exists()

B. isfile()

C. isdir()

D. D. both A and B

Discuss Work Space

Answer: option d

Explanation:

The exists() and isfile() methods are used to check if a file exists in Python.

13. Which function is used to get the current working directory in Python?

A. os.getcwd()

B. os.listdir()

C. os.mkdir()

D. D. os.path()

Discuss Work Space

Answer: option a

Explanation:

The os.getcwd() function is used to get the current working directory in Python.

14. Which function is used to change the working directory in Python?

A. os.chdir()

B. os.getcwd()

C. os.mkdir()

D. D. os.listdir()

Discuss Work Space

Answer: option a

Explanation:

The os.chdir() function is used to change the working directory in Python.

15. Which function is used to create a directory in Python?

A. os.mkdir()

B. os.chdir()

C. os.getcwd()

D. D. os.listdir()

Discuss Work Space

Answer: option a

Explanation:

The os.mkdir() function is used to create a directory in Python.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now