AllInfoHub Logo

AllInfoHub – MCQ Practice

Data Types and Variables – Multiple Choice Questions (MCQs)

  1. 13. What will be the output of `print(type(None))`?

    • A. <class 'NoneType'>
    • B. <class 'null'>
    • C. <class 'void'>
    • D. <class 'nil'>
  2. 14. What will be the output of `print(5 == '5')`?

    • A. TRUE
    • B. FALSE
    • C. Error
    • D. None
  3. 15. Which operator is used to check if a variable belongs to a specific data type?

    • A. type()
    • B. isinstance()
    • C. typeof()
    • D. in_type()
  4. 16. Consider the dictionary `my_dict = {'a': 1, 'b': 2}`. What will be the output of `print(my_dict.get('c', 0))`?

    • A. None
    • B. Error
    • C. 0
    • D. 2
  5. 17. What will be the output of `print(f'{3.14159:.2f}')`?

    • A. 3.14159
    • B. 3.14
    • C. 3.1
    • D. 3.15
  6. 18. Which method is used to remove and return an arbitrary element from a set?

    • A. pop()
    • B. remove()
    • C. discard()
    • D. clear()
  7. 19. What is the data type that represents raw binary data in Python?

    • A. string
    • B. bytes
    • C. bytearray
    • D. int
  8. 20. Which of the following is a false value in Python?

    • A. `''`
    • B. 0
    • C. []
    • D. {}
  9. 21. What will be the output of `print(bool('False'))`?

    • A. TRUE
    • B. FALSE
    • C. Error
    • D. None
  10. 22. What will be the output of `print(type(1/2))`?

    • A. <class 'int'>
    • B. <class 'float'>
    • C. <class 'complex'>
    • D. <class 'Fraction'>
  11. 23. What will be the output of `print(0.1 + 0.2 == 0.3)`?

    • A. TRUE
    • B. FALSE
    • C. It depends on the Python version
    • D. Error
  12. 24. Which method is used to add a key-value pair to a dictionary?

    • A. append()
    • B. add()
    • C. insert()
    • D. update()