Python Data Types Questions and Answers

Take Exam

Python Programming - Data Types Questions with Answers explain how Python stores and handles different types of data. These Python Data Types Questions are important for TCS, RRB, and SSC exams to strengthen programming fundamentals

Python Data Types

Showing 10 of 24 questions

11. How do you check if a key exists in a dictionary?

  • has_key()
  • contains()
  • in
  • exists()
Show Answer Report

12. What is the output of: print(10 // 3)

  • 3.333
  • 3
  • 4
  • 3.0
Show Answer Report

13. Which data type preserves order and allows duplicates?

  • set
  • dictionary
  • list
  • frozenset
Show Answer Report

14. What is the result of: bool(0)

  • True
  • False
  • Error
  • None
Show Answer Report

15. Which method adds an element to the end of a list?

  • insert()
  • add()
  • push()
  • append()
Show Answer Report

16. What is the data type of range(5)?

  • list
  • tuple
  • range
  • generator
Show Answer Report

17. Which operator is used for string repetition?

  • +
  • *
  • x
  • repeat()
Show Answer Report

18. What does the get() method do for dictionaries?

  • Adds a new key-value pair
  • Returns value for key, or default if not found
  • Removes a key-value pair
  • Checks if key exists
Show Answer Report

19. Which of these is a floating point number?

  • 5
  • 5.0
  • "5"
  • [5]
Show Answer Report

20. What is the result of: "hello"[1:4]

  • hel
  • ell
  • ello
  • hell
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test