
Python programming
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
Deiva Praba
Used 49+ times
FREE Resource
Enhance your content in a minute
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In Python 3, the maximum value for an integer is 2^63 - 1:
True
False
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In a Python program, a control structure:
Defines program-specific data structures
Dictates what happens before the program starts and after it terminates
Directs the order of execution of the statements in the program
Manages the input and output of control characters
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What signifies the end of a statement block or suite in Python?
A comment
A line that is indented less than the previous line
end
}
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet:
if 'bar' in {'foo': 1, 'bar': 2, 'baz': 3}:
print(1)
print(2)
if 'a' in 'qux':
.......... .... print(3)
print(4)
1
2
4
1
2
3
4
no ouput
4
5.
FILL IN THE BLANK QUESTION
1 min • 1 pt
Suppose you have the following variables defined:
a = 100
b = 50
Write a Python if/else statement to assign the smaller of a and b to the variable m.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following if/elif/else statement will raise a KeyError exception:
d = {'a': 0, 'b': 1, 'c': 0}
if d['a'] > 0:
print('ok')
elif d['b'] > 0:
print('ok')
elif d['c'] > 0:
print('ok')
elif d['d'] > 0:
print('ok')
else:
print('not ok')
True
False
7.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which of the following are valid if/else statements in Python, assuming x and y are defined appropriately:
if x < y: print('foo'); print('bar'); print('baz')
if x < y: if x > 10: print('foo')
if x < y: print('foo') else: print('bar')
if x < y: print('foo')
elif y < x: print('bar')
else: print('baz')
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
20 questions
STM 2013 : FORMATIF T3-FORM & REPORT
Quiz
•
University
20 questions
Chapter 3: Strategic Initiatives for implementing CA
Quiz
•
University
20 questions
DWDM-2
Quiz
•
University
20 questions
Kiến thức về Thuật toán và Chương trình
Quiz
•
8th Grade - University
20 questions
Artificial Intelligence CT-1
Quiz
•
University
20 questions
Micro Arch - CPUs & Fetch-Execute
Quiz
•
University
20 questions
Cloud Review Quiz
Quiz
•
University
20 questions
Python Recap
Quiz
•
7th Grade - University
Popular Resources on Wayground
8 questions
2 Step Word Problems
Quiz
•
KG - University
20 questions
Comparing Fractions
Quiz
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Latin Bases claus(clois,clos, clud, clus) and ped
Quiz
•
6th - 8th Grade
22 questions
fractions
Quiz
•
3rd Grade
7 questions
The Story of Books
Quiz
•
6th - 8th Grade
Discover more resources for Computers
8 questions
2 Step Word Problems
Quiz
•
KG - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
10 questions
14.2 Independent/Dependent Variables
Quiz
•
KG - University
18 questions
Great Lakes States
Quiz
•
KG - University
7 questions
DNA, Chromosomes, Genes, and Traits: An Intro to Heredity
Interactive video
•
11th Grade - University
7 questions
Reflexive Verbs in Spanish
Lesson
•
9th Grade - University
7 questions
Narrative Writing 1
Interactive video
•
4th Grade - University
