Learn Before
Concept

Assigning a Python Object to Have a Certain Type

If you want to specify the data type of an object, you can use constructor functions like str(), float(), list(), and tuple().

Example: x = list(("apple", "banana", "cherry"))

The example above will turn the sequence into a list

0

0

Updated 2021-02-10

Tags

Python Programming Language

Data Science