
Python Code Output Quiz

Quiz
•
Other
•
University
•
Hard
Logic While
Used 1+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? x = 10 y = 4 result = x ** y // y + y - x % y print(result)
2504
2502
2494
2498
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code produce? x = 4 y = x | (x >> 1) z = y ^ x print(z)
5
2
1
6
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? x, y = 10, 20 if x > y: result = x - y elif x < y: result = y - x else: result = x + y print(result)
0
10
20
30
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code output? x, y = 15, 25 if x > 10 and y < 30: if x + y > 40: print("Sum exceeds 40") else: print("Sum within range") else: print("Condition not met")
Sum exceeds 40
Sum within range
Condition not met
SyntaxError
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? x = 0 while x < 5: x += 1 if x == 3: continue print(x, end=" ")
1 2 3 4 5
1 2 4 5
1 2 4
Infinite loop
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? for i in range(3): for j in range(i, 3): print(i + j, end=" ")
0 1 2 1 2 3
0 1 2 2 3 4
1 2 3 1 3 4
0 1 2 3 4 5
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? lst = [1, 2, 3, 4] for i in range(len(lst)): lst[i] += lst[-i - 1] print(lst)
[5, 5, 5, 5]
[5, 5, 7, 7]
[8, 6, 6, 8]
[5, 5, 8, 9]
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Ինֆորմատիկա

Quiz
•
University
20 questions
Tech quiz-july

Quiz
•
University
15 questions
Quiz Mid Asesmen Psikologi_Kelas A

Quiz
•
University
15 questions
Criminal Defenses

Quiz
•
University
16 questions
Text features/Text Structures

Quiz
•
KG - Professional Dev...
15 questions
Quizz lagii yaa

Quiz
•
University
20 questions
2_Python Условия, Циклы, Модули и Слайсинг

Quiz
•
University
25 questions
Pre-Assessment Test: Python Basics

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Other
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

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

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

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

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University