Data Types & Type Casting
# what is a data type
# data type is used to express the type of variable.
# str is a type used for text.
# int,float and complex are the types for number
# bool is a type for boolean values
# Type-Casting
# typecast integer to string
a = 10
b = str(a)
print(b)
print(type(b)) #we can check the type of variable
#typecast string to integer
c = "10"
d = int(c)
print(d)
print(type(d))
Comments
Post a Comment