NEW
Font size
Worksheetspython l.2
Total questions: 10
Worksheet time: 46mins
numbers = [5, 14, 9, 17]
for number in numbers:
if number % 3 == 0:
print(number)
The output will be?
17
9
14
9
17
14
17
for number in range(6):
print(number)
What is the index of “grape” in the list
[“apple”, “grape”, “orange”, “watermelon”]?
0
1
2
3
What is the result of the following condition if:
A = 30
B = 21
C = 71
(A > B and A > C) or B < C
True
False
c=35 if 34<43 else 43
34
43
35
1
If you add new items to a list, the new items will be placed at the end of the list.
True
False
Output of this code?
[2,4,6,8,10]
['2','4','6','8','10']
[0,2,4,6,8]
[10,8,6,4,2]
The count() method returns the number of times the specified element appears in the list.
What is the output of this code?
3
2
1
0
people = ["John", "Rob", "Bob"]
print (people[-1])
what would this result be?
#What is the output?
1,2,3,4,5
0,1,2,3,4
1,2,3,4
5,4,3,2,1
