''' Purpose: deepen variable manipulation understanding ''' # first generation generation = 1 nbr_rabbits = 6 print( 'Generation: ', generation ) print( 'Rabbits: ', nbr_rabbits ) # Follow our style rules! # It still works the same but enhances readability :) # So use spacing!! :) # Assignment: # Variable = Value (literal) # Values persist! # You can update (reassign values) but it doesn't modify variables # above it without another reassignment for other variables # that may have used the one that you changed. # I hope that made sense... # next generation generation = generation + 1 # This takes the previous value of # generation and adds 1 nbr_rabbits = nbr_rabbits * 2 # This takes the previous value # (the previous assignment) of nbr_rabbits and # multiplying it by two # THIS IS REASSIGNMENT!!!! print( 'Generation: ', generation ) print( 'Rabbits: ', nbr_rabbits ) input() # next generation generation = generation + 1 nbr_rabbits = nbr_rabbits * 2 print( 'Generation: ', generation ) print( 'Rabbits: ', nbr_rabbits ) input() # next generation generation = generation + 1 nbr_rabbits = nbr_rabbits * 2 print( 'Generation: ', generation ) print( 'Rabbits: ', nbr_rabbits ) input() # next generation generation = generation + 1 nbr_rabbits = nbr_rabbits * 2 print( 'Generation: ', generation ) print( 'Rabbits: ', nbr_rabbits ) input()