wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Grade 7 Python

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

What is the term for steps you follow to solve a problem?

a)

Program

b)

Python

c)

Algorithm

d)

Hack

2.

Which command should you use to display the text to the screen?

a)

text()

b)

Print

c)

output()

d)

print()

3.

Which symbol should you use to assign a value to a variable?

a)

+

b)

=

c)

%

d)

/

4.

What is wrong with the following code?



a)

There is no space after the word print.

b)

There are no speech marks “ “ around the text in the brackets.

c)

Print should start with a big P

d)

There should be no brackets ( ).

5.

Look at the flowchart below. What is the output for Price?

a)

13

b)

10

c)

12

d)

3

6.

Which code would display 'Hello World'

a)

Print("Hello World")

b)

print("Hello World")

c)

print(Hello World)

d)

print=("hello world")

7.

Which operator is used to multiply numbers?

a)

%

b)

*

c)

#

d)

x

8.
A data type consisting of numbers, letters and symbols.
a)
String
b)
Integer
c)
Float
d)
Boolean
9.

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

a)

7

b)

1

c)

0

d)

4

10.

Correct file extension for python files?

a)

.py

b)

.pyt

c)

.pt

d)

.pyth

11.

Which operators are used to compare 2 values whether it is equal?

a)

==

b)

=

c)

>

d)

<>

12.

the output of the following code is

# program for addition of 2 numbers

a = 10

b = 3

c = a + b

print("the sum is ", c)

a)

7

b)

10

c)

13

d)

3

13.

output of the following question is:

#program for text addition

# input() method

f_name= "hello"

l_name ="world"

print( f_name + l_name)

a)

helloworld

b)

hello world

c)

error

d)

f_name+l_name

14.

what will be printed for the value 8 for num

# program to check even or odd

num = (int)(input("enter any number"))

if num%2 == 0:

print("the number is even")

else :

print("the number is odd")

a)

even

b)

the number is even

c)

the number is odd

d)

None

15.

Which of the following is correct?

a)

if colour==blue

b)

if colour=blue:

c)

if colour=="blue":

d)

if color=blue

16.

if you type print("4"+"9") what result would you get

a)

49

b)

13

c)

error

d)

0

17.

What is a variable?

a)

A named memory location

b)

a value

c)

a number

d)

a letter

18.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

name

d)

(name)

19.
When you have an error in your code what is the term to summarise finding and fixing that error?
a)
Error checking
b)
Debugging
c)
Syntax finder
d)
Error finder
20.
What is Python?
a)
text based programming language
b)
word processor 
c)
spreadsheet
d)
block based programming language