Font size
WorksheetsPython
Total questions: 35
Worksheet time: 18mins
print("Hello" + str(2) + "world!")
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?
What are the names of the two types of mode that are used in Python? Select two.
Interactive mode
Scratch mode
Imperial mode
Script mode
France
Wales
Wales
France
Ireland
'London', 'Exeter', 'Bristol']
'Bristol', 'Exeter', 'London', ]
To insert an the string "strawberries" in the first position of a list we use
fruit.append("strawberries, 1")
fruit.insert("strawberries",0)
fruit.insert(1, "strawberries")
fruit.insert(0, "strawberries")
print(9/3*2+4-5)
What is a Count-Controlled loop?
for loop
while loop
Which of these is NOT a loop in python?
for loop
while loop
nested loop
if loop
Which of these operators means EQUAL TO?
'='
'=>'
'<='
'=='
What will be the output of this code?
1,2,3,4,5,6,7,8,9,10,11,12
0,2,4,6,8,10
2,4,6,8,10,12
2,4,6,8,10
If i want to continuously check for a correct answer, what loop would i use?
for loop
while loop
Which of the following is invalid?
_a = 1
__a = 1
__str__ = 1
none of the mentioned
Which of the following is an invalid statement?
abc = 1,000,000
a b c = 1000 2000 3000
a,b,c = 1000, 2000, 3000
a_b_c = 1,000,000
What is the output of this expression, 3*1**3?
27
9
3
1
We can insert the new item into tuple
True
False
You are in the car with traffic jammed at a junction. To cross that junction according to the traffic rules, which one is NOT applicable
While loop
Conditional Statement
For loop
