Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

September Quiz: Python

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
2.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

name

d)

(name)

3.
When you have an error in your code what is the term to summarise finding and fixing that error?
a)
Error checking
b)
Debugging
c)
Syntax finder
d)
Error finder
4.
What Python command lets the user enter an answer to a question?
a)
answer()
b)
open()
c)
print()
d)
input()
5.

How did python get its name?

a)

The creator invented it whilst in hospital from a snake bite

b)

The code is written in a snaking structure

c)

The creator named it after Marty Python

d)

The creator named it after Monty Python

6.

What will be the output if the user enters 'child' and 'friday'?

a)

£4.00

b)

£2.50

c)

There will be a syntax error

d)

£2.00

7.

What will be the output of: print ("3+57")

a)

3 + 57

b)

90

c)

60

d)

3+57

8.

REPEAT loops can only be used when:

a)

The integers in a calculation aren't decimal

b)

The data to be repeated is in hexadecimal

c)

They don't exist in python

d)

Dealing with named variables

9.

What does MOD do in a calculation

a)

returns the decimal outcome of a division

b)

returns the remainder after a division

c)

divides a previous division statement

d)

returns two divided integers to their initial value

10.

What can be used to create a line break in printed text?

a)

\N

b)

\\n

c)

/n

d)

\n

11.

How many variables can you assign in a piece of code?

a)

Depends on your PC's clock speed

b)

256

c)

infinity gauntlet

d)

infinite

12.
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’
13.
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
14.
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
15.
102 = 100
Which of the following is used in Python to calculate ten squared?
a)
10 ** 2
b)
10 * 2
c)
10 % 2
d)
10 ** 10
16.

If you want to create an empty list called colours in Python, which of the following is correct?

a)

colours = [ ]

b)

colours = ( )

c)

colours = { }

d)

colours = <>

17.

What letter will be printed on the screen after running this code:

a)

n

b)

e

c)

a

d)

Nothing prints

18.

List items have an index number. In the following list, which item has the index number of 3?

["John", "Harry", "Mac", "Donald", "Colonel", "Tony"]

a)

"Tony"

b)

"Harry"

c)

"Mac"

d)

"Donald"

19.

The list needs one more name added to the end - "Stark". Which piece of code below would do this?

nameList = ["John", "Harry", "Mac", "Donald", "Colonel", "Tony"]

a)

nameList.append(Stark)

b)

append(nameList,"Stark")

c)

nameList.append["Stark",7]

d)

nameList.append("Stark")

20.

What will be the output?

tuple1=['sam', "Pam", 12,44]

print(type(tuple1))

a)

<class 'list'>

b)

<class 'tuple'>