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 = " ")

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 = " ")

3. What will be the output of the following Python code?

x = "abcdef"   i = "a"
while i in x[ :-1 ]:
      print( i , end = " ")

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 = " ")

5. What will be the output of the following Python code?

x = "abcdef"   i = "a"
while i in x[ 1: ]:
      print(i, end = " ")

6. What will be the output of the following Python code?

x = "abcd"
for i in x:
      print(i, end = " ")
      x.upper( )

7. What will be the output of the following Python code?

x = "abcd"
for i in x:
      print(i .upper( ), end = " ")

8. What will be the output of the following Python code?

x = "abcd"
for i in range( x ):
      print(i)

9. What will be the output of the following Python code?

x = "abcd"
for i in range( len(x) ):
      print(i , end = " ")

10. What will be the output of the following Python code?

x = "abcd"
for i in range( len(x) ):
      print(i .upper( ))

11. What will be the output of the following Python code?

x = "abcd"
for i in range( len(x) ):
      i .upper( )
      print( x )

12. What will be the output of the following Python code?

x = "abcd"
for i in range( len(x) ):
      x[i] .upper( )
      print( x )

13. What will be the output of the following Python code?

x = "abcd"
for i in range( len(x) ):
      i[x] .upper( )
      print( x )

14. What will be the output of the following Python code?

x = "abcd"
for i in range( len(x) ):
      x = "a"
      print(x, end = " ")

15. What will be the output of the following Python code?

x = "abcd"
for i in range( len(x) ):
      print(x, end = " ")
      x = "a"

16. What will be the output of the following Python code?

x = 123
for i in x :
      print( i )

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 = " ")

18. What will be the output of the following Python code?

x = "abcd"
for i in range( x ):
      print(i)

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 = " ")

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 = " ")