Time: 20:00

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

d = {0: 'a', 1: 'b', 2: 'c'}
for x in d .values():
      print(x, end = " ")

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

d = {0: 'a', 1: 'b', 2: 'c'}
for x in d .values():
      print( d[ x ] )

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

d = {0, 1, 2}
for x in d .values():
      print( x )

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

d = {0, 1, 2}
for x in d :
      print( x )

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

d = {0, 1, 2}
for x in d :
      print( d.add( x ) )

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

for i in range( 0 ) :
      print( i )

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

for i in range( 2.0 ) :
      print( i )

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

for i in range( int( 2.0 )) :
      print( i )

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

for i in range( float( 'inf' )) :
      print( i )

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

for i in range( int( float( 'inf' ))) :
      print( i )

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

for i in [1, 2, 3, 4] [ : : -1] :
      print( i )

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

for i in ' ' .join( reversed( list( 'abcd' ))) :
      print( i )

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

for i in 'abcd' [ : :-1] :
      print( i )

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

for i in ' ' :
      print( i )

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 = 2
for i in range(x) :
      x + = 1
      print( x )

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

x = 2
for i in range(x) :
      x - = 2
      print( x )

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

for i in range( 10 ) :
      if i == 5 :
             break
      else :
             print( i )
else :
      print( "Here" )

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

for i in range( 5 ) :
      if i == 5 :
             break
      else :
             print( i )
else :
      print( "Here" )

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

x = (0, 1, 2, 3)
for i in range( 3) :
      if i in x:
             print( i )