Python Mcq
Python Mcq
i=2
7 2 3 1 0 2
while(i>0):
i=i-1
Which one of the following is a valid if (a >=
8 if a>=2 : if (a => 22) if a >= 22 if a>=2 :
Python if statement : 2)
9 Which keyword is use for function? define fun def function def
What will be the output of following min
Python code? function
cannot be
10 c C++ C C
list1=["Python","Java","c","C","C++"] used on
string
print(min(list1)) elements
11 The identity operators are ___________ is is not is , is not in, not in is , is not
Python _______________ are written
dictionarie tuples and dictionarie
12 with curly brackets, and they have keys tuples list
s list s
and values.
In dictionary value does not exist without
13 number Key string data Key
____________ and vice versa.
The ____________ parameter is a
reference to the current instance of the
14 self this dot current self
class, and is used to access variables
that belongs to the class.
_________________ is the class that
Virtual Parent Base Child
15 inherits from another class, also called Child Class
Class Class Class Class
derived class.
A variable created inside a function and
Local Global Static Dummy Local
16 can only be used inside that function is
Variable Variable Variable Variable Variable
called as ____________________
__________ function can be used to find
17 high() max() large() maximum() max()
the highest value.
To write to an existing file, you must add "
________" parameter to
18 r a w c a
the open() function.
__________________________
random.ra random.r random.ra random.ran random.ra
41 Generates a random float number
ndint() andfl() ndom() df() ndom()
between 0.0 to 1.0
______________________ Returns a
random integer between the specified random.ra random.r random.ra random.ran random.ra
42
integers. ndint() andfl() ndom() df() ndint()