print 9//2
Dear candidates you will find MCQ questions of Python here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
print 9//2
i = 0 while i < 3: print i print i+1
Explanation: Class is user defined data type.
Explanation: List in python starts with [ and ends with ] .
Anything written inside square brackets is list in python.
def myfunc(a): a = a + 2 a = a * 2 return a print myfunc(2)
Explanation: Python is strict to indentation. Here you might have noticed that the code is not properly indented. So throws an indentation error.
Explanation: ** is short form of power.
In python ** is precedence over *(multiplication) so first ** will be solved.
= 3*(1**3)
= 3*1
= 3
Hence option C is correct.
print '{0:.2}'.format(1.0 / 3)
print '{0:-2%}'.format(1.0 /
3)