Python MCQ Quiz

  1. Which of the following is the use of id() function in python?
  2. Is Python case sensitive when dealing with identifiers?
  3. All keywords in Python are in
  4. Mathematical operations can be performed on a string. State whether true or false -
  5. Which one of the following has the highest precedence in the expression?
  6. What is the return type of function id?
  7. What is the output of the following? print("Hello {0!r} and {0!s}".format('foo', 'bin'))
  8. Which of the following data types is not supported in python ?
  9. Which Of The Following Keywords Mark The Beginning Of The Class Definition?
  10. Select the reserved keyword in python-
  11. Are nested if-else are allowed in Python?
  12. Python allows string slicing. What is the output of below code: s='cppbuzz chicago' print(s[3:5])
  13. class test: def __init__(self): print "Hello World" def __init__(self): print "Bye World" obj=test()
  14. The format function, when applied on a string returns :
Python MCQ

Take Python Quiz To test your Knowledge 

Below are few Python MCQ test that checks your basic knowledge of Python. This Python Test contains around 20 questions of multiple choice with 4 options. You have to select the right answer to a question. You can see the correct answer by clicking view answer link.

Also, Read Best Python Flask interview questions.

  • Every object doesn’t have a unique id
  • Id returns the identity of the object
  • All of the mentioned
  • None of the mentioned
View Answer
  • yes
  • no
View Answer
  • UPPER CASE
  • lower case
  • Capitalized
  • None of the mentioned
View Answer
  • False
  • True
View Answer
  • Addition
  • Multiplication
  • Exponential
  • Parentheses
View Answer
  • float
  • bool
  • dict
  • int
View Answer
  • Hello ‘foo’ and foo
  • Hello foo and foo
  • Hello foo and ‘bin’
  • Error
View Answer
  • String
  • Numbers
  • Slice
  • List
View Answer
  • return
  • class
  • def
  • All of the above
View Answer
  • else
  • raise
  • import
  • All of the above
View Answer
  • list
  • bool
  • int
  • str
View Answer
  • List is mutable && Tuple is immutable
  • List is mutable && Tuple is immutable
  • Both are Mutable.
  • Both are Immutable
View Answer
  • 32 characters
  • 63 characters
  • 79 characters
  • None of the above
View Answer
  • List
  • Dictionary
  • Tuple
  • Class
View Answer
  • 2
  • 17
  • None of these
View Answer
  • yes
  • no
View Answer