Q.1.
What will be the output of the following Python code? for i in range(10): if i == break else: print(i) else: print("Here")
Q.2.
What will be the output of the following Python code? for i in range(5): if i == break else: print(i) else: print("Here")
Q.3.
What will be the output of the following Python code? x = (i for i in range(3)) for i in x: print(i)
Q.4.
What will be the output of the following Python code? x = (i for i in range(3)) for i in x: print(i) for i in x: print(i)
Q.5.
What will be the output of the following Python code? string = "my name is x" for i in string: print (i, end=", ")
Q.6.
What will be the output of the following Python code? string = "my name is x" for i in string.split(): print (i, end=", ")
Q.7.
What will be the output of the following Python code snippet? a = [for a[-in a: print(a[-1])
Q.8.
What will be the output of the following Python code snippet? a = [for a[in a: print(a[0])
Q.9.
What will be the output of the following Python code snippet? a = [i = -2 for i not in a: print(i) i += 1
Q.10.
What will be the output of the following Python code snippet? string = "my name is x" for i in ' '.join(string.split()): print (i, end=", ")