LIMIT = 50000000 # Define a meaning constant (upper case character by convention) # Initialize the first two Fibonacci numbers a, b = 0, 1 # Print the starting number 0, since it is less than the limit print(a) # Use a while loop to generate and print the sequence count = 1 while b < LIMIT: print(f"fib({count}): {b}") # Update the values for the next iteration # The new 'a' becomes the old 'b', and the new 'b' is their sum a, b = b, a + b count += 1 ''' 1. Initialization: preparatory logic before entering the loop. To be executed once. (count = 1) 2. Continuing condition: when the loop should be exit. (b < LIMIT) 3. Iteration code: a block of code to be executed. To be executed as many times as the loop continues. print(f"fib({count}): b") # Update the values for the next iteration # The new 'a' becomes the old 'b', and the new 'b' is their sum a, b = b, a + b 4. Update code: update the variables involved in the continuing condition count += 1 fib(1): 0 fib(2): 1 fib(3): 1 fib(4): 2 '''