Font size
WorksheetsT02: Python - The Basics
Total questions: 10
Worksheet time: 2mins
What is the result of 1 // 2 ?
0
0.5
1.0
1
What is the result of 7 % 5 ?
2
1
1.4
3
Which operator has the highest precedence in Python?
Multiplication
Addition
Exponentiation
Division
Which one uses f-strings correctly?
print("Your age is {}".format(age))
print(f"Your age is {age}")
print("Your age is %d" % age)
print("Your age is " + str(age))
Which of the following is NOT part of the Zen of Python?
Simple is better than complex
Readability counts
Flat is better than nested
Optimisation is king
What is the result of 2 + 3 * 2 ** 2 ?
100
14
64
38
Which of these are NOT valid in Python?
class
my variable
abc
import_from
5days
In Python, how can you get input from the user?
user_input = input()
user_input = read()
user_input = scanf()
user_input = enter()
The first reported computer bug was actually?
A ladybug
A moth
A spider
A beetle
What is the result of type( 7.0 / 2 )
int
float
str
ValueError
