Font size
WorksheetsPython Quiz
Total questions: 10
Worksheet time: 6mins
for num in range(10):
print(num)
1 2 3 4 5 6 7 8 9 10
0
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
10
0 1 2 3 4 5 6 7 8 9 10
What is the "for" loop used for ?
To print a string
To print a number
iterating over a sequence
To print a list
What are the three parameters in Python "for" loop ?
(start, stop, step)
(step, stop, start)
(start, step, stop)
None of the above
Which is used to store multiple items in a single variable.
variable
for loop
Lists
string
subjects = ['Maths','English','Science','Social','Tamil']
What is the index of last item "Tamil"
(a)
Which one is not a list function ?
append()
insert()
pop()
delete()
What is the starting value of range() function by default ?
1
0
-1
What is the output ?
In a list, which method is used to add the elements at the end ?
add()
insert()
append()
b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
What if we slice the list ?
b[3:8]
[4, 5, 6, 7, 8]
[0 , 1 , 2 , 3 , 4 , 5, 6, 7, 8]
[0 , 1 , 2 , 3 , 4]
[5, 6, 7, 8]
