What type of data is "Hello World"?
String
Assign the number 5 to a variable x.
x = 5
What is 5 + 3?
8
Which loop repeats a fixed number of times?
FOR / Count-Controlled
Which Python function displays output on the screen?
print()
What type is 45 in Python?
Integer
Which of these is an invalid variable name? name1, 2name, _name
2name
What is 10 - 4?
6
How many times does the following code print "Hi"?
for i in range(3):
print("Hi")
3
Which Python function asks the user for input?
input()
What type is True in Python?
Boolean
Store Pizza in a variable called food.
food = "Pizza"
What is 6 * 2?
12
Fill in the blank:
for i in range(5):
________ #prints numbers 0 to 4
print(i)
What will print(5 + 4) display?
9
Is 5.5 an integer or a float?
Float
What will be the value of x after x = 3; x = x + 4?
7
What is 16 / 4?
4
Predict the output:
for i in range(1,4):
print(i*2)
2
4
6
Write a Python statement to ask the user for their name and store it in name.
name = input("Enter your name: ")
Which of these is a Boolean value: "True", True, "False"?
True
You have a = 10 and b = 2. Write a Python statement to divide a by b and store in c.
c = a / b
What is the result of 7 % 3?
1
Write a loop to print numbers from 1 to 5
for i in range(1,6):
print(i)
What is the easiest topic you learnt in Computing this year? (Free Pass)
Free Pass