Question:

Which of the following is a valid data type in Python?

Show Hint

In Python, the built-in data types include integers, floating-point numbers (float), complex numbers, and more. Double is not used in Python.
  • integer
  • float
  • double
  • complex
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation

Step 1: Understanding Python data types.
In Python, valid data types include integer, float, and complex. However, Python does not use the data type "double"; instead, it uses "float" to represent floating-point numbers.
Step 2: Evaluating the options.
  • (A) integer: Correct. Integer is a valid data type in Python, used to represent whole numbers.
  • (B) float: Correct. Float is a valid data type in Python, used to represent floating-point numbers.
  • (C) double: Incorrect. Python does not have a "double" data type; it uses "float" for floating-point numbers.
  • (D) complex: Correct. Complex numbers are also a valid data type in Python, represented with a real and imaginary part (e.g., `3 + 4j`).

Step 3: Conclusion.
The correct answer is (D) complex, as it is a valid data type in Python. Final Answer:} complex.
Was this answer helpful?
0
0