
File handling in Python
Quiz by Mrs N Stammers
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Measure skills
from any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
With a free account, teachers can
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
9 questions
Show answers
- Q1What is the method used to close a file in Python?delete()close()remove()rename()30s
- Q2What is the mode used to create a new file in Python?'r''w''a''x'30s
- Q3What method is used to write to a file in Python?delete()read()append()write()30s
- Q4How do you open a file for reading and writing in Python?'r+''w''r''a'30s
- Q5What method is used to read the contents of a file in Python?write()append()delete()read()30s
- Q6What keyword is used to create a file object in Python?readwritecloseopen30s
- Q7What is the default mode for opening a file in Python?'a''r''x''w'30s
- Q8What function in Python is used to delete a file?os.renameos.chdiros.removeos.path30s
- Q9How do you check if a file exists in Python?os.path.access()os.path.directory()os.path.isfile()os.path.exists()30s