Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python - Print & Input Quiz

Total questions: 23

Worksheet time: 14mins

Name
Class
Date
1.
In python the ' STRING data type' can be defined as...?
a)
holds alphanumeric text
b)
hold whole numbers
c)
holds numbers with a decimal point
d)
holds either a true or false value
2.
In python the ' INTEGER data type' can be defined as...?
a)
holds alphanumeric data as text
b)
holds whole numbers
c)
holds numbers with a decimal point
d)
holds either ‘true’ or ‘false’
3.
In python the ' FLOAT data type' can be defined as...?
a)
holds alphanumerical data
b)

holds whole numbers

c)

holds a decimal point in a number

d)
hold either true or false
4.
In python the ' BOOLEAN data type' can be defined as...?
a)
holds alphanumerical data
b)
holds whole numbers
c)
holds a number with a decimal point
d)
holds either true or false
5.

What data type would be used for storing someone's telephone numbers?

a)

Float (using a decimal point)

b)

Integer (just whole numbers)

c)

String (alphanumerical data)

6.
If we needed to store information such as a POSTCODE in PYTHON, what data type would we use?
a)
String (alphanumerical)
b)
Float (decimal point)
c)
Boolean (true or false)
7.
what is the code for a STRING in python?
a)
str
b)
stri
c)
stg
8.
what is correct code for INTEGER in python?
a)
in
b)
ing
c)
int
9.
What is the output from the following code?print ("hello world")
a)
Hello World
b)
hello world
c)
print hello world
10.
What function would I use to display text?
a)
sum
b)
import
c)
print
d)
display
11.
What does a hashtag represent when using Python?
a)
red text
b)
float
c)
comment
d)
integer
12.
Why do we use variables in programming?
a)
edit data
b)
store data
c)
integer
d)
to look good
13.

What does the equal sign mean in this code?


team = input(“Enter a team”)

a)

assignment

b)

equal to

c)

greater than

d)

interger

14.
What does “==” represent in Python programming?
a)
less than
b)
equal to
c)
greater than
d)
not equal to
15.

True or False:

5.0 is an example of the 'float' datatype.

a)

True

b)

False

16.

True or False:

You need to convert an integer to a string before you can use it in the print() function.

a)

True

b)

False

17.

Gjdk is not a good name for a variable, why?

a)

It starts with a capital letter.

b)

It does not contain any spaces.

c)

There are no vowels.

d)

It's meaningless.

18.

In this code, how much does an apple cost?

a)

£1

b)

50p

c)

20p

d)

25p

19.

What would the program display if you ran this code and entered 2 and then 3 when prompted?

a)

The total is 5.

b)

The total is 23.

c)

The total is 6.

d)

An error.

20.

Which symbol is used as an escape character so the computer ignores the next character as syntax

a)

+

b)

-

c)

\

d)

*

21.

Q4. A program runs but it produces the wrong results, what type of error is this?

a)

Syntax error

b)

Logical error

c)

Execution error

d)

Life error

22.

Q4. A program does not run, what type of error is this?

a)

Syntax error

b)

Logical error

c)

Execution error

d)

Life error

23.

what is correct code for a Real number in python?

a)

float

b)

real

c)

flo

d)

rea