7 #Python Free Course:
# Python Casting
# Specify a variable Type
# For integers
a = int(1)
b = int(2.8)
c = int("3")
print(a)
print(b)
print(c)
# For Floats
x = float(1)
y = float(1.6)
z = float("3")
w = float("3.4")
print(x)
print(y)
print(z)
print(w)
# For string
X = str(1)
Y = str(2.4)
Z = str("s1")
print(X)
print(Y)
print(Z)
Post a Comment
If you have any doubts. Please Let me Know