Time:
20:00
1.
What will be the output of the following Python code?
x = "abcdef" i = "a"
while i in x :
print(' i ', end = " ")
no output
i i i i i i...
a a a a a a ...
a b c d e f
2.
What will be the output of the following Python code?
x = "abcdef" i = "a"
while i in x :
x = x[ :-1 ]
print( i , end = " ")
i i i i i i
a a a a a a
a a a a a
none of the mentioned
3.
What will be the output of the following Python code?
x = "abcdef" i = "a"
while i in x[ :-1 ]:
print( i , end = " ")
a a a a a
a a a a a a
a a a a a a ...
a
4.
What will be the output of the following Python code?
x = "abcdef" i = "a"
while i in x:
x = x[ 1: ]
print(i, end = " ")
a a a a a a
a
no output
error
5.
What will be the output of the following Python code?
x = "abcdef" i = "a"
while i in x[ 1: ]:
print(i, end = " ")
a a a a a a
a
no output
error
6.
What will be the output of the following Python code?
x = "abcd"
for i in x:
print(i, end = " ")
x.upper( )
a B C D
a b c d
A B C D
error
7.
What will be the output of the following Python code?
x = "abcd"
for i in x:
print(i .upper( ), end = " ")
a b c d
A B C D
a B C D
error
8.
What will be the output of the following Python code?
x = "abcd"
for i in range( x ):
print(i)
a b c d
0 1 2 3
error
none of the mentioned
9.
What will be the output of the following Python code?
x = "abcd"
for i in range( len(x) ):
print(i , end = " ")
a b c d
0 1 2 3
error
1 2 3 4
10.
What will be the output of the following Python code?
x = "abcd"
for i in range( len(x) ):
print(i .upper( ))
a b c d
0 1 2 3
error
1 2 3 4
11.
What will be the output of the following Python code?
x = "abcd"
for i in range( len(x) ):
i .upper( )
print( x )
a b c d
0 1 2 3
error
none of the mentioned
12.
What will be the output of the following Python code?
x = "abcd"
for i in range( len(x) ):
x[i] .upper( )
print( x )
abcd
ABCD
error
none of the mentioned
13.
What will be the output of the following Python code?
x = "abcd"
for i in range( len(x) ):
i[x] .upper( )
print( x )
abcd
ABCD
error
none of the mentioned
14.
What will be the output of the following Python code?
x = "abcd"
for i in range( len(x) ):
x = "a"
print(x, end = " ")
a
abcd abcd abcd
a a a a
none of the mentioned
15.
What will be the output of the following Python code?
x = "abcd"
for i in range( len(x) ):
print(x, end = " ")
x = "a"
a
abcd abcd abcd abcd
a a a a
abcd a a a
16.
What will be the output of the following Python code?
x = 123
for i in x :
print( i )
1 2 3
123
error
none of the mentioned
17.
What will be the output of the following Python code?
d = {0: 'a', 1: 'b', 2: 'c'}
for i in d :
print(i, end = " ")
0 1 2
a b c
0a 1b 2c
none of the mentioned
18.
What will be the output of the following Python code?
x = "abcd"
for i in range( x ):
print(i)
a b c d
0 1 2 3
error
none of the mentioned
19.
What will be the output of the following Python code?
d = {0: 'a', 1: 'b', 2: 'c'}
for x, y in d.items( ) :
print(x, y, end = " ")
0 1 2
a b c
0a 1b 2c
none of the mentioned
20.
What will be the output of the following Python code?
d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.keys( ) :
print(d[x], end = " ")
0 1 2
a b c
0a 1b 2c
None of the mentioned
Submit