I have tried using a while True statement to repeat asking the question but that just kept spamming the question to the user which was pretty entertaining albeit not very useful.
gen_model = input('Shall we start the missile code generator?')
if gen_model == 'yes':
base = input("What 8 digit base number would you like to start on? ") # This is the starting number.
if len(base) > 8.1 or len(base) < 7.9:
print("Please enter an 8 digit number.")
else:
end_no = input("What 8 digit number would you like to stop at? ") # This is the end number.
start_digits = "CODE"
while True: # while True is always a True statent, similar to while 1==1.
base = (int(base) + 1) # The amount you want to add on to starting number.
print(start_digits + str(base), file=open("SecretCodes.txt", "a")) # str(base) converts the base number to string as you cant do string + integer.
if base > (int(end_no)): # This is the number you want it to stop at.
break # Gets us out of the infinite loop.