Python Files
Test your Python skills with w3resource' quiz. This page contains interesting quizzes related to Python File. The test contains 44 questions with no time limit. You will have to read all the given questions, answers and click over the correct answer.
Sign in to Google to save your progress. Learn more
 Which function is used to write all the characters? *
1 point
 How do you rename a file? *
1 point
 To read the next line of the file from a file object f, we use ___________ *
1 point
 Which function is used to close a file in Python? *
1 point
 Which of the following statements are true? *
1 point
 What is the difference between r+ and w+ modes? *
1 point
 To read the entire remaining contents of the file as a string from a file object f, we use ___________ *
1 point
 To read the remaining lines of the file from a file object f, we use __________ *
1 point
 Which function is used to write a list of string in a file? *
1 point
 Which one of the following is not attributes of file? *
1 point
 Change the file position to an offset value from the starting position. *
1 point
 How do you get the name of a file from a file object (f)? *
1 point
 To open a file c:\text.txt for writing, we use ____________ *
1 point
 Is it possible to create a text file in Python? *
1 point
 Which are the two built-in functions to read a line of text from standard input, which by default comes from the keyboard? *
1 point
 To open a file c:\text.txt for appending data, we use ___________ *
1 point
 In file handling, what does this terms means “r, a”? *
1 point
 Which of the following is not a valid attribute of a file object (f)? *
1 point
 Which function is used to read single line from file? *
1 point
 What is the correct syntax of rename() a file? *
1 point
 Correct syntax of file.writelines() is? *
1 point
 Which of the following are the modes of both writing and reading in binary format in file? *
1 point
 What is the use of truncate() method in file? *
1 point
 What is the use of “a” in file handling? *
1 point
 What will be the output of the following Python code? *
1 point
Captionless Image
 What will be the output of the following Python code? *
1 point
Captionless Image
 How do you get the current position within the file? *
1 point
 What will be the output of the following Python code? *
1 point
Captionless Image
 What is the correct syntax of open() function? *
1 point
  What is the correct syntax to remove() a file? *
1 point
 What happens if no arguments are passed to the seek function? *
1 point
 Correct syntax of file.readlines() is? *
1 point
 Which function is used to read all the characters? *
1 point
 What is the use of tell() method in python? *
1 point
 Which of the following is not a valid mode to open a file? *
1 point
  To open a file c:\text.txt for reading, we use _____________ *
1 point
 How do you close a file object (fp)? *
1 point
 What is the use of seek() method in files? *
1 point
 What will be the output of the following Python code? *
1 point
Captionless Image
 What is the use of “w” in file handling? *
1 point
 Which of the following mode will refer to binary data? *
1 point
 The readlines() method returns ____________ *
1 point
 To read two characters from a file object f, we use ____________ *
1 point
 Command to delete a file. *
1 point
Submit
Clear form
This content is neither created nor endorsed by Google. - Terms of Service - Privacy Policy

Does this form look suspicious? Report