
Python Programming Quiz
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
SUBBURAJ S
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the purpose of variables in Python programming?
The purpose of variables in Python programming is to store and manipulate data.
The purpose of variables in Python programming is to handle exceptions.
The purpose of variables in Python programming is to display output.
The purpose of variables in Python programming is to create loops.
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is a valid data type in Python? a) Integer b) Float c) String d) All of the above
c) String
b) Float
a) Integer
d) All of the above.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code snippet? x = 5 y = 2 print(x % y)
3
1
2
0
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which control flow statement is used to execute a block of code repeatedly as long as a certain condition is true?
for
if
while
switch
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code snippet? numbers = [1, 2, 3, 4, 5] for num in numbers: print(num)
1 2 3 4
1 2 3 4 5
1 2 3 4 5 6
1 2 3 4 5
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which file mode is used to open a file for reading?
w
a
x
r
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code snippet? file = open('data.txt', 'r') print(file.read()) file.close()
The output of the code snippet will be the file object.
The output of the code snippet will be the contents of the 'data.txt' file.
The code will throw an error because the file 'data.txt' does not exist.
The output of the code snippet will be an empty string.
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
Pengantar Coding
Quiz
•
University
18 questions
Memory-Mobo-Hard/Software
Quiz
•
University
20 questions
Digital introductions
Quiz
•
University
20 questions
PARC Linux Basic Part 2
Quiz
•
University
20 questions
CSS Pseudo dan CSS Grid System
Quiz
•
University
10 questions
Adobe Photoshop
Quiz
•
University
10 questions
Choose the level of Bloom’s Taxonomy
Quiz
•
University
15 questions
After Effect Intoduction
Quiz
•
10th Grade - University
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
