WorksheetsPython for grade 5
Total questions: 30
Worksheet time: 16mins
Python language was developed in what year?
1985
2001
1991
1820
Is python an interpreter or compiler programming language?
Compiler
Interpreter
Python uses indentation to block code into chunks
True
False
Python correct naming convention for constants is?
firstName
First_Name
FIRST_NAME
firstname
What output will the console show, if 15 and 30 are entered by the user?
Syntax error
The sum of the two numbers - 45
The concatenation of the two numbers - 1530
Complier error
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
Which one will display when this code is run?
What does the following code do? myAge = int (myAge)
Converts the var (variable) myAge to a string
Converts the var (variable) myAge to a integer
Converts the var (variable) myAge from a integer to a string
Converts the var (variable) myAge to if statement
print("Hello world!" * 2)
people = ["John", "Rob", "Bob"]
print (people[1])
what would this result be?
people = ["John", "Rob", "Bob"]
print (people[-1])
what would this result be?
people = ["John", "Rob", "Bob"]
print (people[4])
what would this result be?
What will be displayed after the code runs?
x = 5
print(x == 2)
True
0
2
false
What is the "a" after the program is executed?
a = 2
If a<3:
print(a+1)
else:
print(a-1)
3
2
1
0
What is b after the program is executed?
b = 2
if b > 4:
b = b + 2
4
2
0
нет правильного ответа
x = 3
c = 0
while x > 1:
c = c +1
x = x -1
3
0
1
2
What will you see after you run this code ?
a = 5
b = 10/2
print(a == b)
True
Error
0
False
What is the value of c ?
a = 2
b = 5
if a > b:
c = a
else:
c = b
2
5
0
