Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Basics Review

Total questions: 18

Worksheet time: 9mins

Name
Class
Date
1.

How would you create a program to display "Hello World!"

a)

print(Hello World!

b)

input("Hello World!")

c)

print("Hello World!")

d)

print(Hello World!)

2.

Which python operator means 'less than or equal to'?

a)

>=

b)

>

c)

<

d)

<=

3.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
4.
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
5.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
6.
What is the name of the programming language we are learning?
a)
Scratch
b)
Python
c)
Pie thin
d)
Scribble
7.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

name

d)

(name)

8.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
a)
True
b)
False
9.
What is Python?
a)
text based programming language
b)
word processor 
c)
spreadsheet
d)
block based programming language
10.
What Python command lets the user enter an answer to a question?
a)
answer()
b)
open()
c)
print()
d)
input()
11.
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")
12.

Which symbol means "not equal to"

a)

%

b)

==

c)

!=

d)

**

13.

What is an example of a boolean?

a)

"Hello!"

b)

56

c)

True/False

d)

46.7

14.

23 == 32

a)

True

b)

False

15.

4 == 4.0

a)

True

b)

False

c)

Error

16.

What is the purpose of a loop in programming?

a)

The purpose of a loop in programming is to repeat a block of code.

b)

The purpose of a loop in programming is to randomly select a block of code.

c)

The purpose of a loop in programming is to skip a block of code.

d)

The purpose of a loop in programming is to execute code only once.

17.

What is the output of the following code?

x = 5
y = 3
print(x + y)

a)

8

b)

2

c)

15

d)

7

18.

What will this symbol do?


\n

a)

Print

b)

Not

c)

New line

d)

Does nothing