Select Page

Welcome to your Python output type Quiz

Name
E mail
1.What is the output of the following program :


def myfunc(a):
      a=a+2
            a=a*2
      return a
print myfunc(2)

2.What is the output of the expression : 3*1**3
3.What is the output of the following program :


print'{0:.2}' . format (1.0 / 3 )

4.What is the output of the following program :
print '{0:-2%}'.format(1.0 / 3)
5.What is the output of the following program :
i = 0
while i < 3:
       print i
       i += 1
else:
      print 0
6.What is the output of the following program :
i = 0
while i < 5:
     print(i)
     i += 1
     if i == 3:
              break
else:
     print(0)
7.What is the output of the following program :
print 'cd'.partition('cd')
8.What is the output of the following program :
print 'abef'.partition('cd')
9.What is the output of the following program :
print 'abcefd'.replace('cd', '12')
10.What will be displayed by the following code?
def f(value, values):  
          v = 1
          values[0] = 44
t = 3
v = [1, 2, 3]
f(t, v)
print(t, v[0])