Font size
WorksheetsProgramming Reviewer by MEDS
Total questions: 50
Worksheet time: 33mins
Which of these will be stored as a float?
"hello"
143
8.4
True
Fill in the blank to output 5 raised to the 3rd power.
print (5__3)
/*
**
^
*
Fill in the blank to take user input, assign it to a variable, and output it:
text=___
print(___)
input(), user
text, input()
user, input()
input(), text
Fill in the blanks to prompt the user with a message and assign the input to the variable “name”:
___=___(“___”)
input, name, “What is your Name?”
“What is your Name?, name, input
name, input, “What is your Name?”
name, “What is your Name?, input
What are the two Boolean values in Python?
Yes and No
True and False
true and false
Truth and Dare
It is a loop use for two dimensional value of data.
For loop
While loop
Nested for loop
All of the Above
What’s the result of this code?
x=“a”
x*=3
print(x)
a3
aaa
3aaa
aaa3
Simplest form of structure in programming, since the flow of the program is linear.
Repetition Control Structure
Selection Control Structure
Iterative Control Structure
Sequential Control Structure
Fill in the blanks to produce a valid code, which takes the values of the x and y variables from the input and outputs their sum.
=___(__(__))
Input, int, y
Input, double, x
Int, input, y
Int, y, input
Which line of code will cause an error?
Line 4.
Line 3
Line 2
Line 1
Is a table-like series of elements which is the best representation for matrices or any form of tabular elements.
2D List
Multi List
One Dimensional Array
Stack
What is the output of this code?
print((4+8)/2)
6
6.0
“6”
“6.0”
What is the output?
from array import *
arr1 = array(‘I’, [1,2,3,4,5])
print (arr1[0])
print (arr1[2])
1 and 2
1 and 3
2 and 3
1 and 4
What is the output?
from array import *
arr1 = array(‘I’, [1,2,3,4,5])
arr1.insert(1,6)
for x in arr1:
print(x)
1,6,2,3,4,5
1,2,6,3,4,5
1,2,3,6,4,5
1,2,3,4,6,5
The given python code is an example of
Sequential Control
Selection Control
Sequential Control
Decision Control
What’s the output of this code?
spam = “eggs”
print(spam*3)
eggseggseggs
spamspamspam
“eggseggseggs”
“spamspamspam”
What is the output of this code?
print( 8 ** (1/3) )
3.0
2.0
3
2
What’s the output of this code?
print(7 != 8)
True
False
0
1
What is the output of this code?
print(1 + 2 + 3 + 4.0 + 5)
15
15.0
“15”
“15.0”
What is the correct answer to output 12?
x = 5
y = __
print(x+y)
7
=7
“7”
‘7’
What is the output of this code?
x=4
x*=3
print(x)
12
12.0
“12”
“12.0”
Which of these is a valid variable name in Python?
a-variable%name
123
A_VARIABLE_NAME
While
What part of an if statement should be indented?
All of it
The statements within it
The first line
There is no indention
What will be the output of this code?
x= “2”
y= “4”
z=int(x)+int(y)
print(z)
6
6.0
“6”
“6.0”
Fill in the blanks.
letters = [‘a’,’b’,’z’]
_ “z” _ letters:
print(“yes”)
(a)
What will be the output?
A
B
C
D
What will be the output?
A
B
C
D
A shorter option for an “else if” statement is:
(a)
What's the output of this code?
(a)
What's the output of this code?
(a)
What's the result of this code?
(a)
Fill in the blank.
(a)
What's the result of this code?
(a)
Fill in the blanks to print "Welcome"
(a)
Fill in the blank to create a loop that increments the value of x by 2 and print the even values.
(a)
If rc="5". What is the output?
(a)
What is the output?
(a)
What is the output of the given code?
(a)
What is the output of the given code?
(a)
What is the output of the given code?
(a)
Fill in the blanks.
(a)
Fill in the blanks.
(a)
What's the result of this code?
nums=[5,4,3,2,1]
print(nums[1])
5
4
3
2
1
What's the output of this code?
x=[2,4]
y=[2,4,6]
print(x[1]/y[0])
2
2.0
4
4.0
What is the output of the code.
a=[1,2,3]
b=[2,4,6]
print(b+a)
[1,2,3,4,6]
[1,2,3,2,4,6]
[2,4,6,1,2,3]
[2,4,6,1,3]
What is the output of this code.
nums=[10,9,8,7,6,5]
nums[0]=nums[1]-5
if 4 in nums:
print(nums[3])
else:
print(nums[4])
5
6
7
8
is a free-hand drawing that is used to create shapes, pictures or images by providing the user a virtual canvas.
Tkinter
Turtle
It is a standard GUI (Graphical User Interface) of python that creates different gui like checkbox, canvas or button using the widget.
Tkinter
Turtle
is a data structure consisting of related data items of the name and the same data type.
Array
Python
Turtle
List
is a collection of data of either the same or different data types, it is use in data structure that is a mutable, or changeable, ordered sequence of elements.
Array
Python
Turtle
List
