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) boolShow All Answers 3. Which of the following represents a floating-point number? (A) 5 (B) 3.14 (C) True (D) "5"Show All Answers 4. Which data type has only two possible values: True or False? (A) int (B) float (C) bool (D) strShow All Answers 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 = 5Show All Answers 6. Which of the following is a valid variable name in Python? (A) 2number (B) my-number (C) number_2 (D) my numberShow All Answers 7. Which of the following is used to check the type of a variable in Python? (A) datatype() (B) check() (C) typeof() (D) type()Show All Answers 8. What is the output of type(5.0) in Python? (A) int (B) bool (C) str (D) floatShow All Answers 9. Which of the following converts an integer to a string in Python? (A) int() (B) str() (C) float() (D) bool()Show All Answers 10. Which of the following converts a string to an integer in Python? (A) str() (B) bool() (C) float() (D) int()Show All Answers 11. Which of the following is mutable in Python? (A) list (B) str (C) int (D) tupleShow All Answers 12. Which of the following is immutable in Python? (A) list (B) dict (C) set (D) tupleShow All Answers 13. Which of the following stores multiple items in a single variable? (A) int (B) float (C) str (D) listShow All Answers 14. What will be the type of x after the statement x = True? (A) int (B) str (C) bool (D) floatShow All Answers 15. Which of the following is a valid assignment statement? (A) 5 = x (B) x := 5 (C) x == 5 (D) x = 5Show All Answers 16. Which of the following is used to store a collection of key-value pairs? (A) list (B) dict (C) tuple (D) setShow All Answers 17. Which of the following is a sequence data type in Python? (A) bool (B) dict (C) list (D) intShow All Answers 18. What is the type of "Hello World"? (A) int (B) str (C) float (D) boolShow All Answers 19. Which of the following is used to represent no value in Python? (A) None (B) False (C) 0 (D) ""Show All Answers 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) listShow All Answers 21. Which data type is used to store text in Python? (A) int (B) float (C) str (D) boolShow All Answers 22. Which of the following represents a floating-point number? (A) 5 (B) 3.14 (C) True (D) "5"Show All Answers 23. Which data type has only two possible values: True or False? (A) int (B) float (C) str (D) boolShow All Answers 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 = 5Show All Answers 25. Which of the following is a valid variable name in Python? (A) 2number (B) number_2 (C) my-number (D) my numberShow All Answers 26. Which of the following is used to check the type of a variable in Python? (A) check() (B) type() (C) typeof() (D) datatype()Show All Answers 27. What is the output of type(5.0) in Python? (A) int (B) str (C) float (D) boolShow All Answers 28. Which of the following converts an integer to a string in Python? (A) str() (B) int() (C) float() (D) bool()Show All Answers 29. Which of the following converts a string to an integer in Python? (A) str() (B) float() (C) int() (D) bool()Show All Answers 30. Which of the following is mutable in Python? (A) int (B) str (C) tuple (D) listShow All Answers 31. Which of the following is immutable in Python? (A) list (B) tuple (C) dict (D) setShow All Answers 32. Which of the following stores multiple items in a single variable? (A) list (B) int (C) str (D) floatShow All Answers 33. What will be the type of x after the statement x = True? (A) int (B) str (C) bool (D) floatShow All Answers 34. Which of the following is a valid assignment statement? (A) 5 = x (B) x = 5 (C) x == 5 (D) x := 5Show All Answers 35. Which of the following is used to store a collection of key-value pairs? (A) list (B) dict (C) tuple (D) setShow All Answers 36. Which of the following is a sequence data type in Python? (A) list (B) dict (C) bool (D) intShow All Answers 37. What is the type of "Hello World"? (A) int (B) float (C) bool (D) strShow All Answers 38. Which of the following is used to represent no value in Python? (A) None (B) False (C) 0 (D) ""Show All Answers 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 = 10Show All Answers