Worksheets12IP
Total questions: 20
Worksheet time: 20mins
Name
Class
Date
1.
To repeat a fixed number of times use a
a)
while loop
b)
for loop
c)
if loop
d)
indentation
2.
To repeat until a particular condition is true use
a)
while loop
b)
for loop
c)
if loop
d)
indentation
3.
The second part of if, that is executed when the condition is false
a)
if
b)
else
c)
for
d)
input
4.
Data type that can only be true or false
a)
int
b)
string
c)
boolean
d)
float
5.
What does the print function do in python?
a)
It's a variable.
b)
It can input data.
c)
It displays something like a string or integer
d)
It loops the code.
6.
A data type consisting of numbers, letters and symbols.
a)
String
b)
Integer
c)
Float
d)
Boolean
7.
A location in memory used to store data that can be changed.
a)
Constant
b)
Value
c)
Variable
d)
Iteration
8.
What will the output be from the following code?
print(Hello world!)
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
9.
What will the output be from the following code?
print(3+4)
print(3+4)
a)
3+4
b)
7
c)
SyntaxError
d)
print(3+4)
10.
What will the output be from the following code?
print(3*4+5)
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
11.
What does the following code do?
name = input("what is your name")
name = input("what is your name")
a)
says hello
b)
asks for the users DOB
c)
Asks for the users name and stores it in a variable
d)
Checks information
12.
What will be the output?
name = 'Dave'
print (name)
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
13.
Python is an example of a....
a)
Text-based programming language
b)
Object orientated programming language
c)
language written in java script
d)
Visual-based programming language
14.
An example of increment is :-
a)
count=1
b)
count=count+1
c)
count+1=count
d)
total=count+1
15.
A float value always has
a)
A constant
b)
A capital
c)
A lowercase
d)
A decimal
16.
== means
a)
Is not equal too
b)
Is equal too
c)
Is over the amount by...
d)
Is greater than
17.
Remainder in python is found by
a)
/
b)
#
c)
@
d)
%
18.
A WHILE loop needs a
a)
IF statement
b)
condition
c)
loop
d)
for loop
19.
The second part of if, that is executed when the condition is false
a)
if
b)
else
c)
for
d)
input
20.
How do you insert comment into a python code
a)
#comment
b)
/* Comment */
c)
// Comment
100 %
