wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Basics

Total questions: 25

Worksheet time: 13mins

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 Python command lets the user enter an answer to a question?
a)
answer()
b)
open()
c)
print()
d)
input()
5.
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")
6.

Is python an interpreter or compiler programming language?

a)

Compiler

b)

Interpreter

7.

Python is uses braces to block off code

a)

True

b)

False

8.

Python uses indentation to block code into chunks

a)

True

b)

False

9.
What is the name of the environment in Python that write your programs and then test them out?
a)
Shell
b)
Window
c)
IDLE
d)
CLI
10.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
11.
What will the output be from the following code?
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
12.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
13.
Returns the remainder from division
a)
modulus
b)
exponents
c)
boolean
d)
variables
14.
A data type than can have one of two values: True or False
a)
boolean
b)
variable
c)
modulus
d)
interpreter
15.
What will the output be from the following code?
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
16.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
17.
What will the output be from the following code?
print("Hello" + "world!")
a)
Hello world!
b)
Helloworld!
c)
SyntaxError
d)
"Hello" "world!"
18.
What will the output be from the following code?
print(3+4)
a)
3+4
b)
7
c)
SyntaxError
d)
print(3+4)
19.

What is the value of the expression 100 / 25?

a)

4

b)

4.0

c)

"4.0"

d)

'4.0'

20.

Which is the correct operator for power(x^y)?

a)

X^y

b)

X**y

c)

X^^y

d)

None of the mentioned

21.

What is the answer of this expression, 22 % 3 is?

a)

7

b)

1

c)

0

d)

5

22.

x = 5


print(x > 3 and x < 10)

a)

True

b)

False

23.

x = "5"

y = 5


print(x == y)

a)

True

b)

False

24.

x = 5


x%=3


print(x)

a)

2

b)

2.0

c)

3

d)

3.0

25.

Select the operators in python

a)

and

b)

&&

c)

||

d)

not

e)

in