Font size
WorksheetsReview Python_G8
Total questions: 28
Worksheet time: 19mins
What will this code output?
A number from 0 to 1
A number from 0 to 100
A number from 1 to 100
error
What will this code output?
error
A number from 0 to 6
A number from 1 to 5
A number from 1 to 6
What will this code output?
A number from 1 to 1.1
1
1.1
error
Which of the following would allow the user to enter data?
elif
output
input
Which of the following symbols means more than?
<
>
==
!=
Which of the following is correct?
if colour==blue
if colour=blue:
if colour=="blue":
if color=blue
Which code would display 'Hello World'
Print("Hello World")
print("Hello World")
print(Hello World)
print=("hello world")
If you type 6//2 what result would you get in python.
3.0
4
3
0
If you type 10/5 what result would you get in python?
2
2.0
0
15
if you type print("4"+"9") what result would you get
49
13
error
0
What is a variable?
A named memory location
a value
a number
a letter
Which of the following is NOT a suitable variable name?
num1
Num1
MyName
My name
if you entered 7%2 what result would you get in python?
3
1
2
0
Which of the following would generate a random number?
number =random.randit
number=randon.randnt(0,100)
number=random.randint(0,100)
number=random(0,100)
Which of the following means not equal to?
==
=
!=
<
Which commands might be correct? (Multiple answers)
random. random(1, 10)
print(random.random( ))
print(random. randint(1,10))
import.random(2.7)
What symbol is used in python to assign values to a variable?
:
*
=
==
What is the end after if statements?
if
Elif
Else
While
Which of the following is a correctly-formatted comment?
*Comment
"Comment"
#comment
(comment)
A data type than can have one of two values: True or False
Boolean
Basic Calculation
For
While
Data type for a whole number
Float
Boolean
Integer
String
A Python data type that holds positive and negative whole numbers
String
int
str
input
The Boolean operator that returns true if EITHER of its operands are true
and
or
not
equal
Which of the following sequences would be generated by the given line of code?
range (10, 0, -5)
10,9,8,7,6,5
10, 5
0, 5, 10
10, 5, 0
In a Python program, what would be the increment value for the looping variable in the FOR LOOP code?
for x in range (25, 10, -5)
10
-5
25
5
Which of the following pieces of code defines a list of all the numbers from 4 to 12?
range(4,12)
range(4, 13)
range( 3,12)
range(3, 13)
// means:
two times division
integer division
exact division with floating number
Put a slash
What does symbol % do?
Integer exact division
Percentage
Division
Remainder
