CSE MCQs :: Python MCQs
-
What is the output of the following?i = 2while True:if i%3 == 0:breakprint(i)i += 2
-
What is the output of the following?x = "abcdef"i = "a"while i in x:x = x[:-1]print(i, end = " ")
-
What is the output of the following?x = "abcdef"i = "i"while i in x:print(i, end=" ")
-
What is the output of the following?x = 'abcd'for i in x:print(i.upper())
-
What is the output of the following?x = 'abcd'for i in range(len(x)):x[i].upper()print (x)
-
What is the output of the following?d = {0: 'a', 1: 'b', 2: 'c'}for x in d.values():print(x)
-
What is the output of the following?d = {0: 'a', 1: 'b', 2: 'c'}for x in d.keys():print(d[x])
-
What is the output of the following?for i in range(float('inf')):print (i)
-
What is the output of the following?string = "my name is x"for i in string.split():print (i, end=", ")
-
What is the output of the following?a = [0, 1, 2, 3]for a[0] in a:print(a[0])