What is the output of the following code:
x = 3
if 2 > x :
print 'First'
else :
print 'Second'
if 2 > x :
print 'Third'
print 'Fourth'
print 'Fifth'
Quiz1_HPB2021_2010t1
Quiz
•
Computers, Biology
•
1st - 12th Grade
•
Easy
Ali Afzalian Mand
Used 5+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the output of the following code:
x = 3
if 2 > x :
print 'First'
else :
print 'Second'
if 2 > x :
print 'Third'
print 'Fourth'
print 'Fifth'
Second
Fourth
Fifth
First
Second
Third
Fourth
Fifth
Fifth
First
Third
Fifth
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
1. Which of the below statements will create a Python list?
list1 = list()
list1 = []
list1 = list([1, 2, 3])
all of the mentioned
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
If list_example is [2, 33, 222, 14, 25], What is list_example[:-1]?
Error
25
[2, 33, 222, 14]
[25, 14, 222, 33, 2]
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Find the output of the following Python code snippet:
print 'ab cd-ef'.title(),
Ab cd-ef
Ab Cd-ef
Ab Cd-Ef
None of the mentioned
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Find the output of the following Python code snippet?
print('abcd'.translate({97: 98, 98: 99, 99: 100}))
bcde
abcd
error
none of the mentioned
6.
OPEN ENDED QUESTION
3 mins • 1 pt
Shortly explain why the output of the following Python code is 16?
count={}
count[(1,2,4)] = 5
count[(4,2,1)] = 7
count[(1,2)] = 6
count[(4,2,1)] = 2
tot = 0
for i in count:
tot=tot+count[i]
print(len(count)+tot)
output:16
Evaluate responses using AI:
OFF
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the statements about dictionary values is false?
More than one key can have the same value
The values of the dictionary can be accessed as dict[key]
Values of a dictionary must be unique
Values of a dictionary can be a mixture of letters and numbers
15 questions
Python Basics
Quiz
•
KG - University
14 questions
year 8 lesson 2 quiz - python
Quiz
•
8th - 10th Grade
12 questions
Year 7 Python
Quiz
•
7th Grade
10 questions
Python Variables
Quiz
•
6th Grade
11 questions
Python Boolean
Quiz
•
11th - 12th Grade
13 questions
Python Iteration
Quiz
•
10th Grade
13 questions
Python
Quiz
•
7th - 8th Grade
11 questions
PYTHON "If" Statement
Quiz
•
6th Grade
15 questions
Multiplication Facts
Quiz
•
4th Grade
25 questions
SS Combined Advisory Quiz
Quiz
•
6th - 8th Grade
40 questions
Week 4 Student In Class Practice Set
Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025
Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)
Quiz
•
9th - 12th Grade
15 questions
June Review Quiz
Quiz
•
Professional Development
20 questions
Congruent and Similar Triangles
Quiz
•
8th Grade
25 questions
Triangle Inequalities
Quiz
•
10th - 12th Grade
15 questions
Multiplication Facts
Quiz
•
4th Grade
25 questions
SS Combined Advisory Quiz
Quiz
•
6th - 8th Grade
40 questions
Week 4 Student In Class Practice Set
Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025
Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)
Quiz
•
9th - 12th Grade
20 questions
Congruent and Similar Triangles
Quiz
•
8th Grade
25 questions
Triangle Inequalities
Quiz
•
10th - 12th Grade
14 questions
Exterior and Interior angles of Polygons
Quiz
•
8th Grade