Professional Documents
Culture Documents
com)
Expressions
Operators
Data types
Python automatically detects the type of the entered value. With “type(‘XXX’)” Python will return the
type of the evaluated variable or value.
Integer + Integer = Integer
Integer * Integer = Integer
Integer / Integer = Float
Integer + Float = Float
y='a' yy='asdf'
print(type(y)) print(type(yy))
<class 'str'> <class 'str'>
User input
To read a number from user it must be converted to an integer.
name_user=input('Who are you?\n >\t' ) age_user=int(input('How old are you?\n >\t'))
print('Welcome,', name_user) print('So you were born in',(2021-age_user))