Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Introduction to Python programming

Total questions: 20

Worksheet time: 12mins

Name
Class
Date
1.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
2.
What is a variable?
a)
A box(memory location) where you store values
b)
a type of graphics
c)
Data type
d)
a type of memory
3.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
4.
What is the name of the programming language we are learning?
a)
Scratch
b)
Python
c)
Pie thin
d)
Scribble
5.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

name

d)

(name)

6.
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
7.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
a)
True
b)
False
8.
What Python command lets the user enter an answer to a question?
a)
answer()
b)
open()
c)
print()
d)
input()
9.
Which statement correctly assigns the string "Tanner" to the variable name?
a)
name  = print( "Tanner")
b)
input("Tanner")
c)
name = "Tanner"
d)
name = input("Tanner")
10.

What would print (10 + 16) produce?

a)

10

b)

16

c)

24

d)

26

11.

What is a input?

a)

To plug in something.

b)

A function that allows us to ask the user to enter some data.

c)

Data displayed on a screen.

d)

A function

12.

name=input("What is your name? ")

print("Your name is " + name)

What will be displayed if the user types in "Bob"?

a)

Your name is name

b)

name

c)

Bob

d)

Your name is Bob

13.

What, if anything, is wrong with the following?

input=x("Type your password: ")

print(x)

a)

The variable should be switched with the input command

b)

Input commands don't need ( )

c)

You can't print x

d)

Nothing is wrong

14.

What, if anything, is wrong with the following?

x=input("Type your password: ")

print("You typed", x)

a)

The variable should be switched with the input command

b)

You can't use commas in print statements

c)

You can't print x

d)

Nothing is wrong

15.
The correct way to write a variable in Python?
a)
my_variable = 10
b)
my variable = 10
c)
my_variable is 10
d)
my_variable: 10
16.

What does symbol % do?

a)

Integer exact division

b)

Percentage

c)

Division

d)

Remainder

17.

Which symbol represents multiplication?

a)

*

b)

/

c)

+

d)

**

18.
What will the output be from the following code?
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
19.

What is the answer to?

print(10 % 4)

a)

1

b)

3

c)

2

d)

4

20.
What is python?
a)
A programming language 
b)
DTP software 
c)
Spreadsheet software
d)
Computer