-
Hajipur, Bihar, 844101
Difficulty Level: medium
This quiz tests your understanding of writing and creating files in Python, which is an essential skill for saving data, generating reports, logging information, and storing user input in applications. Python allows developers to create new files and write content using the open() function with different file modes such as write and append. Learning how to write files helps you build programs that can store information permanently and manage data efficiently. Read the instructions carefully before you begin the quiz.
Quiz Format
Total Questions: 10
Difficulty Level: Medium
Question Type: Multiple Choice
Each question has one correct answer.
Timing
Total time limit: 5 minutes
Answer steadily and avoid spending too much time on any single question.
Scoring
Each correct answer = +1 point
No negative marking
Maximum Score = 10 points
How to Play
Read each question carefully and review the Python code examples provided.
Understand how to create files using open() with w mode.
Learn how to write content using write() and writelines().
Focus on how append mode a adds data without overwriting existing content.
Observe how files are created automatically if they do not exist.
Identify correct and incorrect syntax when writing files.
Pay attention to closing files properly.
Understand how to use the with statement for safe file handling.
Choose the option that best represents correct Python file writing behavior.
Once you move to the next question, you cannot return to previous ones.
Rules
Do not refresh or close the quiz window during the attempt.
Avoid using notes, books, or online references.
Keep track of the remaining time during the quiz.
Before You Start
You can revise the topic here: Python Write/Create Files Tutorial
After Submission
Your score will be displayed instantly.
Review the correct answers to understand mistakes.
This will help you confidently write and create files in Python programs.