Font size
WorksheetsYear 9 assessment
Total questions: 22
Worksheet time: 14mins
What result will display in the shell if 15 and 20 is entered by the user?
"num1 + num2"
1520
35
What datatype will the answer be if the user enters 15 and 30?
Integer
String
Boolean
Float
Python is a
text language
database language
programming language
Code for Hello, World!
print Hello, World!
print("Hello, World!)
print("Hello, World!")
Code for
Five is greater than two!
if 5 > 2:
print("Five is greater than two!")
if 5 = 2:
print("Five is greater than two!")
if 5 > 2: Print("Five is greater than two!")
Write the four mathematical symbols for python (4 points)
The program above
prints all the odd numbers between 1 and 20
prints all even numbers between 1 and 20
print all the odd numbers between 1 and 21
prints all the even numbers between 1 and 21
The equivalent of the above for loop using the while syntax would be
Look at the following code, what will it generate
1,2,3,4,5,6,7,8,9,10,11,12
0,1,2,3,4,5,6,7,8,9,10,11,12
1,2,3,4,5,6,7,8,9,10,11,12,13
0,1,2,3,4,5,6,7,8,9,10,11,12,13
if you wished a loop to repeat 3 types whwt should you use?
For counter in range(0,5):
For counter in range(1.3):
For counter in range(0.3):
what is the name of the variable used in the following code?
counter
for
#
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
......(repeated continuously)
