NSCT – Data Types & Variables MCQs 39 min Score: 0 Attempted: 0/39 Subscribe 1. Which of the following is a numeric data type in Python? (A) bool (B) str (C) int (D) listShow All Answers 2. Which data type is used to store text in Python? (A) str (B) int (C) float (D) bool 3. Which of the following represents a floating-point number? (A) 5 (B) 3.14 (C) True (D) "5" 4. Which data type has only two possible values: True or False? (A) int (B) float (C) bool (D) str 5. What is the correct way to declare a variable in Python? (A) var x = 5 (B) declare x = 5 (C) int x = 5 (D) x = 5 6. Which of the following is a valid variable name in Python? (A) 2number (B) my-number (C) number_2 (D) my number 7. Which of the following is used to check the type of a variable in Python? (A) datatype() (B) check() (C) typeof() (D) type() 8. What is the output of type(5.0) in Python? (A) int (B) bool (C) str (D) float 9. Which of the following converts an integer to a string in Python? (A) int() (B) str() (C) float() (D) bool() 10. Which of the following converts a string to an integer in Python? (A) str() (B) bool() (C) float() (D) int() 11. Which of the following is mutable in Python? (A) list (B) str (C) int (D) tuple 12. Which of the following is immutable in Python? (A) list (B) dict (C) set (D) tuple 13. Which of the following stores multiple items in a single variable? (A) int (B) float (C) str (D) list 14. What will be the type of x after the statement x = True? (A) int (B) str (C) bool (D) float 15. Which of the following is a valid assignment statement? (A) 5 = x (B) x := 5 (C) x == 5 (D) x = 5 16. Which of the following is used to store a collection of key-value pairs? (A) list (B) dict (C) tuple (D) set 17. Which of the following is a sequence data type in Python? (A) bool (B) dict (C) list (D) int 18. What is the type of "Hello World"? (A) int (B) str (C) float (D) bool 19. Which of the following is used to represent no value in Python? (A) None (B) False (C) 0 (D) "" 20. Which of the following is a valid variable assignment with multiple variables in one line? (A) x = 5 y = 10 (B) x = 5, y = 10 (C) x = 5; y = 10 (D) x, y = 5, 10 (A) int (B) str (C) bool (D) list 21. Which data type is used to store text in Python? (A) int (B) float (C) str (D) bool 22. Which of the following represents a floating-point number? (A) 5 (B) 3.14 (C) True (D) "5" 23. Which data type has only two possible values: True or False? (A) int (B) float (C) str (D) bool 24. What is the correct way to declare a variable in Python? (A) var x = 5 (B) x = 5 (C) int x = 5 (D) declare x = 5 25. Which of the following is a valid variable name in Python? (A) 2number (B) number_2 (C) my-number (D) my number 26. Which of the following is used to check the type of a variable in Python? (A) check() (B) type() (C) typeof() (D) datatype() 27. What is the output of type(5.0) in Python? (A) int (B) str (C) float (D) bool 28. Which of the following converts an integer to a string in Python? (A) str() (B) int() (C) float() (D) bool() 29. Which of the following converts a string to an integer in Python? (A) str() (B) float() (C) int() (D) bool() 30. Which of the following is mutable in Python? (A) int (B) str (C) tuple (D) list 31. Which of the following is immutable in Python? (A) list (B) tuple (C) dict (D) set 32. Which of the following stores multiple items in a single variable? (A) list (B) int (C) str (D) float 33. What will be the type of x after the statement x = True? (A) int (B) str (C) bool (D) float 34. Which of the following is a valid assignment statement? (A) 5 = x (B) x = 5 (C) x == 5 (D) x := 5 35. Which of the following is used to store a collection of key-value pairs? (A) list (B) dict (C) tuple (D) set 36. Which of the following is a sequence data type in Python? (A) list (B) dict (C) bool (D) int 37. What is the type of "Hello World"? (A) int (B) float (C) bool (D) str 38. Which of the following is used to represent no value in Python? (A) None (B) False (C) 0 (D) "" 39. Which of the following is a valid variable assignment with multiple variables in one line? (A) x = 5, y = 10 (B) x, y = 5, 10 (C) x = 5; y = 10 (D) x = 5 y = 10