Python MCQ Quiz
Python MCQ Quiz
com
Python MCQ Quiz
A. yes
B. no
A. UPPER CASE
B. lower case
C. Capitalized
D. None of the mentioned
Q4. Mathematical operations can be performed on a string. State whether true or false -
A. False
B. True
Q5. Which one of the following has the highest precedence in the expression?
A. Addition
B. Multiplication
C. Exponential
D. Parentheses
A. float
B. bool
C. dict
D. int
Q7. What is the output of the following? print("Hello {0!r} and {0!s}".format('foo', 'bin'))
A. String
B. Numbers
C. Slice
D. List
Q9. Which Of The Following Keywords Mark The Beginning Of The Class Definition?
A. return
B. class
C. def
D. All of the above
A. Yes
B. no
Q12. Python allows string slicing. What is the output of below code: s='cppbuzz chicago'
print(s[3:5])
A. buzzc
B. pbuzz
C. bu
D. None of these
Q13. class test: def __init__(self): print "Hello World" def __init__(self): print "Bye
World" obj=test()
A. Bye World
B. Hello World
C. Compilation Error
D. Ambiguity
A. list
B. bool
C. int
D. str
A. 32 characters
B. 63 characters
C. 79 characters
D. 31 Characters
Q17. Which one of the following is not a python's predefined data type?
A. List
B. Dictionary
C. Tuple
D. Class
A. 13
B. 15
C. 2
D. None of these
Q19. 19 % 2 in python
A. 2
B. 17
D. None of these
A. /
B. +
C. ()
D. -
Q21. Is Tuple mutable?
A. yes
B. no