Here is the code:
#Take two variables ‘x’ and ‘y’. Save an integer value (e.g. 5) in x and floating value (e.g. (5.7) in y. #Change the type of integer value to float and floating value to int. Now print both numbers and observe the result.
x = 5
y = 5.7
print('X = ', x, '(Integer data type)')
print('Y = ', y, '(Float data type)')
print('After changing the data type of both the variables:')
a = float(x)
b = int(y)
print('X = ', a, '(Float data type)' )
print('Y = ', b, '(Integer data type)')
# This code is contributed by Ahmad Shafiq
This Post Has One Comment
Pingback: cheap cialis