def hailstone(n):
print(n,end=' ')
while n!=1:
if n%2==1:
n=3*n+1
print(n,end=' ')
else:
n=n/2
print(n,end=' ')
hailstone(7)
Output: 7 22 11.0 34.0 17.0 52.0 26.0 13.0 40.0 20.0 10.0 5.0 16.0 8.0 4.0 2.0 1.0
Hello, I wonder why python prints these integer numbers as float numbers after 22. Thanks.