67.0k views
3 votes
All elements in a Python list must have the same data type. True /False

1 Answer

4 votes

Answer:

False

Step-by-step explanation:

Python lists can contain elements of different data types, such as integers, strings, and booleans. For example, a list can contain both integers and strings like [1, "apple", 2, "orange"]. However, it is generally good practice to use lists to store elements of the same or similar data types for clarity and ease of use.

User Ghasem
by
7.8k points

No related questions found