M3 R5 Python MCQ
M3 R5 Python MCQ
i=1
while True:
if i%3 == 0:
break
print(i)
i+=1
a) 1 2 3
b) error
c) 1 2
d) none of the mentioned
Ans: b
a)16
b) 32
c) 64
d) None of the above
Ans : d
a) Object
b) Function
c) Attribute
d)Argument
Ans: b
16. Which one of the following has the highest precedence in the expression?
a) Division
b) Subtraction
c) Power
d) Parenthesis
Ans :d
Ans: d
22. Which of the following statements assigns the value 25 to the variable x in Python:
a) x ← 25
b) x = 25
c) x := 25
d) int x = 25
Ans :c
23. Select the correct example of complex datatype in Python
a) 3 + 2j
b) -100j
c) 5j
d) All of the above are correct
Ans :d
24. If x=3.123, then int(x) will give?
a) 1
b) 0
c) 1
d) 3
Ans:d
29. Which of the following functions print the output to the console ?
a) Output( )
b) Print( )
c) Echo( )
d) print( )
Ans : d
31. To print a line a text without ending it with a newline… argument is used with print ( )
a) sep
b) newline
c) end
d) next
Ans: c
34. Name the statement that sends back a value from a function.
a) print
b) return
c) input
d) none
Ans: b
35. Which values are used by the functions to communicate information back to the caller?
a) local
b) global
c) random
d) return
Ans :d
36. Which line of code produces an error?
a) “PythonMcq” + “12”
b) ‘PythonMcq’ + 16
c) 3 + 7
d) ‘PythonMcq’ + “21”
Ans: b