83.5k views
3 votes
Which of the following is not a valid data type in Python?

1) Integer
2) String
3) Boolean
4) Character

User Milander
by
8.8k points

1 Answer

4 votes

Final answer:

Character is not a separate data type in Python, as single characters are considered strings; therefore, 'Character' is the invalid data type among the options.

Step-by-step explanation:

The student has asked which of the following is not a valid data type in Python:

  1. Integer
  2. String
  3. Boolean
  4. Character

In Python, the valid data types are integer, string, and boolean. However, character is not a separate data type in Python, as single characters are simply strings of length one.

Therefore, the correct answer is Character.

User Nisarg Patil
by
7.7k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.

9.4m questions

12.2m answers

Categories