wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

G5 T3A W2 Intro To Python

Total questions: 27

Worksheet time: 15mins

Name
Class
Date
1.

How can you use the print function in Python as a calculator?

a)

Enclose the mathematical expression in quotation marks within the print function

b)

Directly input the mathematical expression within the print function.

c)

Use the print function with a loop to perform calculations

d)

Assign the result of the calculation to a variable and then print the variable

2.

What will be the output of print(5 + 3)?

a)

7

b)

8

c)

2

d)

10

3.

How can you print multiple items in Python using the print function?

a)

print(item1, + item2, + item3)

b)

print(item1 + item2 + item3)

c)

print(item1, item2, item3)

d)

print(item1 item2 item3)

4.

Can you use the print function to print numbers in Python?

a)

No, the print function only works with strings

b)

Yes, but only if the numbers are within a specific range

c)

Yes, but you need to import a special module to print numbers

d)

Yes

5.
What is the output from the following code?print ("hello world")
a)
Hello World
b)
hello world
c)
print hello world
6.
Choose what * performs.
a)
multiplication
b)
addition
c)
division
d)
subtraction
7.
What is missing from this program – print(hello)?
a)
‘‘  ’’
b)
:: 
c)
??
d)
***  ***
8.
What is the correct name for a *?
a)
hashtag
b)
star
c)
loop
d)
asterisk
9.
What function would I use to display text?
a)
sum
b)
import
c)
print
d)
display
10.

Python is a .......................

a)

webpage

b)

Progrmming languagea

c)

Non programming Language

d)

Snake

11.

What is a variable?

a)

A math operator

b)

An element, feature, or factor that is liable to vary or change.

c)

An if statement

d)

A computer system that can change

12.

What does print("hello) display?

a)

hello

b)

gives you an error

c)

"hello"

d)

"hello

13.

What is a variable?

a)

A math operator

b)

An element, feature, or factor that is liable to vary or change.

c)

An if statement

d)

A computer system that can change

14.

What does print("hello) display?

a)

hello

b)

gives you an error

c)

"hello"

d)

"hello

15.

What does the following code display?


a = 1

b = 2

print(a + a)

a)

2

b)

3

c)

4

d)

22

16.

What is casting?

a)

When you convert a variable value from one type to another.

b)

When you assign a string

c)

When you create a boolean

d)

When you display an integer

17.

'my name' is a valid variable?

a)

No

b)

Yes

18.
What is syntax?
a)
Syntax is the word used to describe an error
b)
Syntax is the rules of the programming language
c)
It is used to read information
d)
It is used to output information 
19.

Finding and fixing the errors in a program

a)

Indentation

b)

Nesting

c)

Event Block

d)

Debugging

20.

How will the following code look on the screen?

print ("I love programming.")

print ("I love programming.")

a)

"I love programming."

"I love programming."

b)

I love programming.

I love programming.

c)

I love programming. I love programming.

d)

I LOVE PROGRAMMING

I LOVE PROGRAMMING

21.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
22.
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
23.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
24.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

name

d)

(name)

25.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
a)
True
b)
False
26.
What is Python?
a)
text based programming language
b)
word processor 
c)
spreadsheet
d)
block based programming language
27.
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")