MCQs
Total Questions : 10
Answer: Option B. -> a b c
Loops over the values.
Answer: Option D. -> none of the mentioned
Error, objects of type float cannot be interpreted as an integer.
Answer: Option C. -> my, name, is, x
Variable i takes the value of one word at a time.
Answer: Option A. -> 0 1 2 3
The value of a[0] changes in each iteration. Since the first value that it takes is itself, there is no visible error in the current example.
Answer: Option B. -> a b c
Loops over the keys and prints the values.
Answer: Option A. -> no output
"i is not in "abcdef.
Answer: Option B. -> 2 4
The numbers 2 and 4 are printed. The next value of i is 6 which is divisible by 3 and hence control exits the loop.
Answer: Option B. -> a a a a a a
The string x is being shortened by one charater in each iteration.
Answer: Option A. -> abcd
Changes do not happen in-place, rather a new instance of the string is returned.
Answer: Option B. -> A B C D
The instance of the string returned by upper() is being printed.