Font size
WorksheetsGrade 7 Python
Total questions: 20
Worksheet time: 10mins
What is the term for steps you follow to solve a problem?
Program
Python
Algorithm
Hack
Which command should you use to display the text to the screen?
text()
output()
print()
Which symbol should you use to assign a value to a variable?
+
=
%
/
What is wrong with the following code?
There is no space after the word print.
There are no speech marks “ “ around the text in the brackets.
Print should start with a big P
There should be no brackets ( ).
Look at the flowchart below. What is the output for Price?
13
10
12
3
Which code would display 'Hello World'
Print("Hello World")
print("Hello World")
print(Hello World)
print=("hello world")
Which operator is used to multiply numbers?
%
*
#
x
What is the answer to this expression, 22 % 3 is?
7
1
0
4
Correct file extension for python files?
.py
.pyt
.pt
.pyth
Which operators are used to compare 2 values whether it is equal?
==
=
>
<>
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)
7
10
13
3
output of the following question is:
#program for text addition
# input() method
f_name= "hello"
l_name ="world"
print( f_name + l_name)
helloworld
hello world
error
f_name+l_name
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")
even
the number is even
the number is odd
None
Which of the following is correct?
if colour==blue
if colour=blue:
if colour=="blue":
if color=blue
if you type print("4"+"9") what result would you get
49
13
error
0
What is a variable?
A named memory location
a value
a number
a letter
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
