wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python for Beginners

Total questions: 10

Worksheet time: 5mins

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 will be the output?

name = 'Python'

print (name)

a)

'Python'

b)

Python

c)

python

d)

'python'

3.

Choose the correct syntax for Python

a)

IF answer == "Yes":

b)

if answer == "Yes"

c)

if answer == "Yes":

d)

if answer == "yes"

4.

Why would you use a loop?

a)

To input data

b)

To print data

c)

To repeat a piece of code

5.

Mathematical operations can be performed on a string

a)

True

b)

False

6.

What is the output of this expression, 3*1**3

a)

3

b)

9

c)

27

d)

1

7.

How would you assign an integer to a variable?

a)

new_var == 4

b)

new_var = 4

c)

new_var = "4"

d)

new_var "4"

8.

How would would you print a text string?

a)

output "Hello!"

b)

print ("Hello!")

c)

print (Hello!)

d)

output (Hello!)

9.

Which symbol do we use if we want to add a comment to our code?

a)

@

b)

#

c)

!

d)

&

10.

To create a variable named new_var and assign it a value of 25 divided by 5, which statement would you use?

a)

new_var = 25 \ 5

b)

new_var = "25 \ 5"

c)

new_var = 25 / 5

d)

new_var = "25 / 5"