11. Which of the following results in a SyntaxError?
a) ‘”Once upon a time…”, she said.’
b) “He said, ‘Yes!’”
c) ‘3\’
d) ”’That’s okay”’
12. The following is displayed by a print function call. Select all of the function calls that result in this output.
tom
dick
harry
a)
print(”’tom
\ndick
\nharry”’)
advertisement
b) print(”’tomdickharry”’)
c) print(‘tom\ndick\nharry’)
d)print(‘tom
dick
harry’)
13. What is the average value of the following Python code snippet?
>>>grade1 = 80
>>>grade2 = 90
>>>average = (grade1 + grade2) / 2
a) 85.0
b) 85.1
c) 95.0
d) 95.1
14. Select all options that print.
hello-how-are-you
a) print(‘hello’, ‘how’, ‘are’, ‘you’)
b) print(‘hello’, ‘how’, ‘are’, ‘you’ + ‘-‘ * 4)
c) print(‘hello-‘ + ‘how-are-you’)
d) print(‘hello’ + ‘-‘ + ‘how’ + ‘-‘ + ‘are’ + ‘you’)
15. What is the return value of trunc()?
a) int
b) bool
c) float
d) None
16. What is the output of print 0.1 + 0.2 == 0.3?
a) True
b) False
c) Machine dependent
d) Error
17. Which of the following is not a complex number?
a) k = 2 + 3j
b) k = complex(2, 3)
c) k = 2 + 3l
d) k = 2 + 3J
18. What is the type of inf?
a) Boolean
b) Integer
c) Float
d) Complex
19. What does ~4 evaluate to?
a) -5
b) -4
c) -3
d) +3
20. What does ~~~~~~5 evaluate to?
a) +5
b) -11
c) +11
d) -5
Page 1 2 3
Python Interview Questions (MCQs)
We have divided these Python Questions and Answers into various parts based on the topics. Open the Topic of your choice and Practice these MCQs.