Using a function to calculate the hailstone sequence

# -*- coding: utf-8 -*-
"""
Created on Wed Mar 24 11:40:07 2021

@author: rmontant
"""
def hailstone( x ):
    if x % 2 == 0:  # even x
        x_next = x / 2
    else:
        x_next = (x * 3) + 1
    return int(x_next)
#--------


def main():
    x0 = int(input('Starting x? '))

    xn = x0
    while True:
        xn = hailstone( xn )
        print(xn)
        if xn == 1:
            break
    print('Done.')
#--------


main()