
Python Programming Quiz
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Hard
Janaki Sivakumar
Used 1+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct syntax to create a function in Python?
function myFunction():
def myFunction[]:
def myFunction():
create function myFunction():
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? x = [1, 2, 3] print(x * 2)
[1, 2, 3, 1, 2, 3]
[2, 4, 6]
[[1, 2, 3], [1, 2, 3]]
Error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to read a file in Python?
file = open("filename.txt", "r")
file = open("filename.txt")
file = open("filename.txt", "read")
file = open("filename.txt", "w")
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? my_list = [2, 4, 6, 8] my_list.append(10) print(my_list)
[2, 4, 6, 8]
[2, 4, 6, 8, 10]
[10, 2, 4, 6, 8]
None of the above
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following data structures does Python's set type represent?
Ordered collection of unique elements
Unordered collection of unique elements
Ordered collection with duplicate elements
Unordered collection with duplicate elements
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the difference between a list and a tuple in Python?
Lists are immutable, tuples are mutable
Tuples are immutable, lists are mutable
Lists are faster to iterate over
Tuples allow duplicate values while lists do not
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? x = 5 y = 10 x, y = y, x print(x, y)
5 10
10 5
None None
Error
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
Bài 10-Thực hành khai thác tài nguyên trên Internet
Quiz
•
10th - 12th Grade
10 questions
Microcontroller
Quiz
•
11th Grade - University
14 questions
Input, output and storage de
Quiz
•
8th Grade - Professio...
14 questions
Topologías de red!
Quiz
•
12th Grade
10 questions
Review Quiz #2- Productivity Tools
Quiz
•
11th - 12th Grade
15 questions
Основные теги THML
Quiz
•
12th Grade
10 questions
ZOOM QUIZ
Quiz
•
1st - 12th Grade
15 questions
Quis Grade 5
Quiz
•
9th - 12th 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
