PYHTON PROGRAM
"""
Program for typecasting and takes inputs from user
"""
A=input("Enter a name:")
a=(int(input("Enter a number:")))
b=(float (input("Enter a number 2:")))
print(type(a))
# type of a is integer.
Z=str(a)
#typecasting operation is performed.
print(Z)
#value of a and Z is same but types are different.
print(type(Z))
#type of a is now str.
No comments:
Post a Comment
let me know which type examples you want to comment me.