NEW
Font size
WorksheetsPython Training Day-6 Quiz-6
Total questions: 10
Worksheet time: 5mins
Python executes one statement after another from beginning to the end of the program. This is a ________________
Selection Construct
Sequential Construct
Iteration Construct
None of the above
Which of the following statement is not assigning a numerical value 8 to variable X, if original value of X is 0? ?
X = 8
X + = 8
X *= 8
None of the above
Ram wants to create a program to check whether an year is leap year or not. For this he should have a good understanding of ____________
Conditional Statement
for loop
while loop
All of the above
What will be the output of the following Python code?
i = 1
while True:
if i%3 == 0:
break
print(i)
i + = 1
1 2 3
error
1 2
none of the mentioned
What will be the output of the following Python code snippet?
for i in [1, 2, 3, 4][::-1]:
print (i)
4 3 2 1
error
1 2 3 4
none of the mentioned
What will be the output of the following Python program?
i = 0
while i < 5:
print(i)
i += 1
if i == 3:
break
else:
print(0)
error
0 1 2 0
0 1 2
none of the mentioned
What will be the output of the following Python program?
def addItem(listParam):
listParam += [1]
mylist = [1, 2, 3, 4]
addItem(mylist)
print(len(mylist))
5
8
2
1
What will be the output of the following Python code snippet?
d = {"john":40, "peter":45}
print(list(d.keys()))
[“john”, “peter”]
[“john”:40, “peter”:45]
(“john”, “peter”)
(“john”:40, “peter”:45)
What will be the output of the following Python code snippet?
a = [0, 1, 2, 3]
for a[-1] in a:
print(a[-1])
0 1 2 3
0 1 2 2
3 3 3 3
error
