Font size
WorksheetsGrade 7
Total questions: 21
Worksheet time: 12mins
Is Python case sensitive when dealing with identifiers?
Yess
No
Which of the following is an invalid variable?
my_string_1
1st_string
foo
_
Which is the correct operator for power(xy)?
X^y
X**y
X^^y
Which one of these is floor division?
/
//
%
What is the answer to this expression, 22 % 3 is?
7
1
0
4
Mathematical operations can be performed on a string.
True
False
What is the output of this expression, 3*1**3?
27
9
3
1
Which one of the following has the same precedence level?
Addition and Subtraction
Multiplication, Division and Addition
Addition and Multiplication
The expression Int(x) implies that the variable x is converted to integer.
True
False
Insert the missing part of the code below to output "Hello World".
(a) ("HELLO WORLD")
Comments in Python are written with a special character, which one?
(a)
Create a variable named carname and assign the value Volvo to it.
(a)
Create a variable named x and assign the value 50 to it.
(a)
Display the sum of 5 + 10, using two variables: x and y.
Remove the illegal characters in the variable name:
2my-first_name = "John"
my-first_name = "John"
myfirst_name = "John"
myfirstname = "John"
The following code example would print the data type of x, what data type would that be?
x = 5
print(type(x))
(a)
The following code example would print the data type of x, what data type would that be?
x = "Hello World"
print(type(x))
(a)
The following code example would print the data type of x, what data type would that be?
x = 20.5
print(type(x))
(a)
Which of the following symbols is used in a while loop to test if one value is equal to another?
=
<=
==
Correct file extension for python files?
.py
.pyt
.pt
.pyth
Which operators are used to compare 2 values whether it is equal?
==
=
>
<>
