
python_quiz4
Authored by Ibrahim Khaleel
Computers
9th - 12th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is not a method of opening files?
Append
Replace
Read
Write
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the last action that must be performed on a file?
End
Write
Save
Close
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When will the else part of try-except-else be executed?
always
when an exception occurs
when no exception occurs
never
Answer explanation
The else part is executed when no exception occurs.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Is the following Python code valid?
try:
# Do something
except:
# Do something
else:
# Do something
no, there is no such thing as else
no, else cannot be used with except
no, else must come before except
yes
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the function used to open a file in Python?
open()
read()
write()
close()
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the default mode for opening a file in Python?
'r'
'w'
'a'
'x'
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the syntax for opening a file in write mode?
file = open("filename.txt", "w")
file = open("filename.txt", "r")
file = open("filename.txt", "a")
file = open("filename.txt", "x")
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Kuis Pengayaan (Aplikasi Sehari-hari?
Quiz
•
9th Grade
20 questions
lilja_mak
Quiz
•
5th - 11th Grade
10 questions
Scratch
Quiz
•
KG - Professional Dev...
15 questions
Cyber Security KS4
Quiz
•
8th - 12th Grade
18 questions
12AIT - All About W3C <3
Quiz
•
10th Grade - University
15 questions
MVC-PHP
Quiz
•
12th Grade
13 questions
வகுப்பு 12 - அடோப் இன்டிசைன் CC 2019
Quiz
•
12th Grade
13 questions
WJEC GCSE ICT Unit 1 E-Mail
Quiz
•
9th - 10th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade