Select Page

Quiz-Python Output Type

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])

Quiz-Python operators

Welcome to your Python Operators Quiz

Name
E mail
What is the output of the following code ?
9//2
Which function overloads the >> operator?
Which operator is overloaded by the or() function?
What is the output of the following program :

i=0
while i<3:
          print i
          i++
          print i+1

Quiz-Python Data Types

Welcome to your Python data types quiz

Name
E mail
1.Which of these is not a core data type?
2.What data type is the object below ? L = [1, 23, ‘hello’, 1]
3.Which of the following function convert a string to a float in python?
4.Which of the following statement(s) is TRUE?

  1. A hash function takes a message of arbitrary length and generates a fixed length code.

  2. A hash function takes a message of fixed length and generates a code of variable length.

  3. A hash function may give the same hash value for distinct messages.

Quiz-Python Functions

Welcome to your Python Functions Quiz

Name
E mail
What will be the output of the following code :


print type ( type ( int ))

What is the output of the following code :
L = ['a','b','c','d']
print "".join(L)
What is the output of the following segment :
chr(ord('A'))
What is the output of the following program :
y = 8
z = lambda x : x * y
print z(6)
What is called when a function is defined inside a class?
Which of the following is the use of id() function in python?
What is the output of the following program :
import re
sentence = 'horses are fast'
regex = re.compile('(?P<animal>w+) (?P<verb>w+) (?P<adjective>w+)')
matched = re.search(regex, sentence)
print(matched.groupdict())
Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.pop(1)?
time.time() returns ________
Consider the results of a medical experiment that aims to predict whether someone is going to develop myopia based on some physical measurements and heredity. In this case, the input dataset consists of the person’s medical characteristics and the target variable is binary: 1 for those who are likely to develop myopia and 0 for those who aren’t. This can be best classified as

Testing Quiz

Welcome to your %Testing Quiz%

Name
Email
mobile number
What is Testing??