
Python Code Output Quiz

Quiz
•
Computers
•
5th Grade
•
Hard
Yasmeen Kanwal
Used 4+ times
FREE Resource
18 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? def calculate (num1, num2=4): res = num1 * num2 print(res) calculate(5, 6) Hint: functions in Python
20
The program executed with errors
30
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Can we use the “else” block for for loop? for example: for i in range(1, 5): print(i) else: print("this is else block statement" )
No
Yes
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following x = 36 / 4 * (3 + 2) * 4 + 2 print(x) Hint: Python Operators Precedence
182.0
37
117
The Program executed with errors
4.
OPEN ENDED QUESTION
3 mins • 1 pt
Which operator has higher precedence in the following list % (Modulus) & (BitWise AND) ** (Exponent) > (Comparison)
Evaluate responses using AI:
OFF
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The in operator is used to check if a value exists within an iterable object container such as a list. Evaluate to True if it finds a variable in the specified sequence and False otherwise.
True
False
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? var = "James" * 2 * 3 print(var)
JamesJamesJamesJamesJamesJames
JamesJamesJamesJamesJames
Error: invalid syntax
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? str = "pynative" print (str[1:3])
py
yn
pyn
yna
Create a free account and access millions of resources
Similar Resources on Wayground
17 questions
Python 1

Quiz
•
1st Grade - University
14 questions
Lists, Subroutines and Sequence in Pseudocode - Python

Quiz
•
1st - 11th Grade
19 questions
Scratch Quiz

Quiz
•
4th - 8th Grade
14 questions
Basic Python Quiz 3

Quiz
•
5th Grade
20 questions
Programming Quiz

Quiz
•
1st - 10th Grade
20 questions
How computers work? (Computing Systems)

Quiz
•
5th Grade
19 questions
Y5 ICT

Quiz
•
5th Grade
21 questions
Coding Vocabulary Quiz

Quiz
•
5th - 9th Grade
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