
Python Programming Quiz

Quiz
•
Information Technology (IT)
•
University
•
Medium
Abhishek Swami
Used 5+ times
FREE Resource
40 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet? x = 5 if x > 3: print("A") else: print("B")
B
A
Error
None of the above
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct syntax for an if statement in Python?
if x > y then:
if (x > y)
if x > y:
if x > y {
3.
OPEN ENDED QUESTION
3 mins • 1 pt
x = 10 y = 20 if x > y: print("X is greater") else: print("Y is greater")
Evaluate responses using AI:
OFF
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Choose the correct code to complete the following program: x = 15 if x % 2 == 0: print("Even") else: __________
print("Odd")
print("Even")
print("None")
print(x)
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which statement is used to exit a loop?
exit
break
continue
stop
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which data structure is commonly used to mimic a switch statement in Python?
List
Dictionary
Tuple
Set
7.
OPEN ENDED QUESTION
3 mins • 1 pt
def switch_demo(x): switcher = { 1: "One", 2: "Two", 3: "Three" } return switcher.get(x, "Invalid") print(switch_demo(2))
Evaluate responses using AI:
OFF
Create a free account and access millions of resources
Similar Resources on Wayground
40 questions
Java MCQ Quiz

Quiz
•
University
45 questions
Chapter 9 - Chapter 10 Revision Question Python

Quiz
•
University
35 questions
ASTS TIK 5 GENAP

Quiz
•
5th Grade - University
40 questions
Ujian Akhir TIK Kelas V

Quiz
•
5th Grade - University
40 questions
REMEDIAL PSAS (TULIS NAMA LENGKAP DAN KELAS)

Quiz
•
10th Grade - University
35 questions
PENSAMIENTO ALGORÍTMICO

Quiz
•
University
40 questions
Grade 11 Week 2 Quiz

Quiz
•
11th Grade - University
40 questions
AI-basic 2

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Information Technology (IT)
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University