WorksheetsPythonDS
Total questions: 15
Worksheet time: 11mins
The program above
prints all the odd numbers between 1 and 20
prints all even numbers between 1 and 20
print all the odd numbers between 1 and 21
prints all the even numbers between 1 and 21
The above program prints
Numbers 1 to 10 in reverse order
Numbers 1 to 11 in reverse order
Numbers 1 to 10
Numbers 1 to 11
The program above prints the sum of all the numbers between 0 and 101 that are
alternate odd numbers
alternate even numbers
alternate numbers
What is the output of the program above
10
15
18
17
16
What is the value of the variable sum after the code above executes
54
44
64
34
74
What does this program print
2 + 2 = 4
4 + 4 = 8
8 + 8 = 16
16 + 16 = 32
32 + 32 = 64
2 + 2 = 4
2 + 2 = 4
2 + 2 = 4
2 + 2 = 4
2 + 2 = 4
2 + 2 = 4
2 + 4 = 6
2 + 6 = 8
2 + 8 = 10
2 + 10 = 12
2 + 2 = 4
2 + 2 = 4
2 + 2 = 4
2 + 2 = 4
2 + 2 = 4
2 + 4 = 6
2 + 6 = 8
2 + 8 = 10
The code snippet above outputs
error
None
NaN
-1
The output of the code above is
Key Error
4
Math
The code above prints
Math
Physics
Chemistry
English
4
3.8
3.6
3.7
None
None
None
None
NaN
NaN
NaN
NaN
What is the output of the program above
e
y
t
g
The output of the code above is
[101, 102, 103, 104]
[3.6, 3.7, 3.8, 4]
Assume the key is the student's id and the value is the grade. Which of the following code will get the grade of student id 102.
grades[102]
grades.get(102)
grades[2]
grades[3]
grades.key(102)
Which of the following code deletes the key 103 and its value
del grades[103]
grades.pop(103)
del grades["103"]
grades.pop("103")
