Selected examples from lecture and textbooks
Hailstone Sequence Function
## hailstone : int -> int def hailstone(seed): "Generates the hailstone sequence; seed must be >= 1" print(f'Starting value: {seed}') onetime = True while onetime: if seed % 2 == 1: seed = seed * 3 + 1 else: seed = seed // 2 print(f'Next value = {seed}') onetime = seed != 1 return seed