Join 36000+ teachers and students using TTIO.
User Input - Integers
There are three numeric types in Python. Remember 'int' or integer refers to a whole number (with no decimal points)
int
float
complex
Variables of numeric types are created when you assign a value to them:
Example
x = 1 # int
y = 2.8 # float
z = 1j # complex
To verify the type of any object in Python, use the type()
function:
print(type(x))
print(type(y))
print(type(z))
Suggested Video
Teaching/Learning Presentation
www.teachyourselfpython.com