wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Programming Basics

Total questions: 12

Worksheet time: 6mins

Name
Class
Date
1.

What is the word (command) used to display output within Python?

a)

print

b)

input

c)

output

d)

display

2.

What is a variable?

a)

A box(memory location) where you store values

b)

A box(memory location) where you store multiple values

c)

Data type

d)

A static memory value

3.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
4.
What will be the output?
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
5.

Which of these would work as a piece of code in Python?

a)

IF answer == "Yes":

b)

if answer == "Yes"

c)

if answer == "Yes":

d)

if answer = "yes":

6.

What function is used to output a message in python?

a)

print ("")

b)

print = ("")

c)

print

d)

Print ("")

7.

What syntax would you use to create a name variable in Python?

a)

name=input()

b)

input=name

c)

name=input{}

d)

name=INPUT

8.

If you want multiple options for your code, what should you use (after if)?

a)

elif

b)

else

c)

if

9.

Returns the remainder from division.

a)

DIV

b)

MOD

10.

A data type consisting of numbers with decimals.

a)

integer

b)

float / real

c)

string

d)

boolean

11.

A data type consisting of whole numbers.

a)

integer

b)

float / real

c)

string

d)

boolean

12.

A data type consisting of a single character.

a)

integer

b)

character

c)

string

d)

boolean