
Python Programming Quiz
Quiz
•
Information Technology (IT)
•
University
•
Hard
Ms.ROOP R
Used 4+ times
FREE Resource
Enhance your content in a minute
58 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is the correct syntax for defining a function in Python?
function my_function():
def my_function:
def my_function():
function: my_function()
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How do you create a new list with elements from another list, doubled?
[x * 2 for x in my_list]
[2 * x for x in my_list]
[2 + x for x in my_list]
list([2 * x for x in my_list])
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is the correct syntax to open a file for reading in Python?
open('file.txt', 'r')
file.open('file.txt', 'read')
open.read('file.txt')
open('file.txt')
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How would you write a lambda function to return the square of a number x?
lambda x: x * x
lambda x: x^2
square(x) = x * x
def square(x): return x * x
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is a correct way to catch an exception in Python?
try except Exception as e:
try: except Exception:
try: raise Exception
try: catch:
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the correct syntax for importing the math module in Python?
import math
from math import *
include math
use math
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which statement is used to end a loop or function in Python?
break
exit
end
return
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
56 questions
ICTU LẬP TRÌNH HĐT - BÀI 3
Quiz
•
University
57 questions
Soal Tes Wawasan Kebangsaan Paskibraka
Quiz
•
University
61 questions
AV1-AVALIAÇÃO 1- 3 TRIMESTRE- PROGRAMAÇÃO E ROBÓTICA DURVAL 2025
Quiz
•
12th Grade - University
54 questions
SOAL PKK - 2 Tahun 2024-2025
Quiz
•
2nd Grade - University
60 questions
TIK MANAJEMEN PENDIDIKAN AP KLS B
Quiz
•
University
60 questions
Wireshark Assessment
Quiz
•
University
53 questions
Networking Quiz
Quiz
•
University
56 questions
Модульна контрольна робота з нереляційних баз даних
Quiz
•
University
Popular Resources on Wayground
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Order of Operations
Quiz
•
5th Grade
20 questions
Halloween
Quiz
•
5th Grade
16 questions
Halloween
Quiz
•
3rd Grade
12 questions
It's The Great Pumpkin Charlie Brown
Quiz
•
1st - 5th Grade
20 questions
Possessive Nouns
Quiz
•
5th Grade
10 questions
Halloween Traditions and Origins
Interactive video
•
5th - 10th Grade
Discover more resources for Information Technology (IT)
10 questions
Halloween Movies Trivia
Quiz
•
5th Grade - University
12 questions
Halloween
Quiz
•
3rd Grade - University
5 questions
Using Context Clues
Interactive video
•
4th Grade - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
14 questions
Eat Healthy,Be Healty
Quiz
•
4th Grade - University
7 questions
History of Halloween: Pagan or Christian?
Interactive video
•
11th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
