# Casting - Floats
x = 5
print("Original value:", x)
print("Type of x:", type(x))
x = float(x)
print("Casted value:", x)
print("Type of x:", type(x))
Original value: 5
Type of x: <class 'int'>
Casted value: 5.0
Type of x: <class 'float'>
5
` to the variable `x
`. We then use the `print(
)` function to print the original value of `x
`, as well as its type.float()
` function to cast `x
` to a float. We assign the result of the `float()
` function back to the variable `x
`. print()
` function to print the casted value of `x
`, as well as its type.float()
` function has converted the integer value `5
` to the float value `5.
0`.