Professional Documents
Culture Documents
02 Lesson Type Conversion
02 Lesson Type Conversion
02 Lesson Type Conversion
Hello Rune!
You were born in 1990.
type(birth_year)
str
int(birth_year)
1990
Hello Rune!
You are 31 old!
int("30")
30
int(" -4")
-4
float("2")
2.0
float("3.14")
3.14
float(3)
3.0
s = "This is a string"
i = 7
s + i
s + str(i)
'This is a string7'