Lesson 11: Type Conversion — int(), str(), float()
In this lesson we meet a new command — input(), which receives text from the user — and learn to convert text to a number with int() and float(), and a number to text with str().
int("3") gives the number 3. str(3) gives the string "3". float("2.5") gives 2.5.
- cast
- Converting a value from one type to another.