Asking for Input, and Converting Types

input() asks a question in the terminal and always hands back the answer as text, so a program turns typed numbers into numbers with int() or float() (and numbers into text with str()), checks a value's type with type(), and stops with a ValueError when the text isn't a number.

By

Updated

Cheat sheet: Asking for Input, and Converting Types
Category
Python
Level
Apprentice
Tags
Data Type (python), input() (python), python, Type Conversion (python), type()