Guest User

Untitled

a guest
May 1st, 2020
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.89 KB | None | 0 0
  1. gen_model = input('Shall we start the missile code generator?')
  2. if gen_model == 'yes':
  3.     base = input("What 8 digit base number would you like to start on?  ") # This is the starting number.
  4.     if len(base) > 8.1 or len(base) < 7.9:
  5.         print("Please enter an 8 digit number.")
  6.     else:
  7.         end_no = input("What 8 digit number would you like to stop at?  ") # This is the end number.
  8.         start_digits = "CODE"
  9.         while True: # while True is always a True statent, similar to while 1==1.
  10.             base = (int(base) + 1) # The amount you want to add on to starting number.
  11.             print(start_digits + str(base), file=open("SecretCodes.txt", "a")) # str(base) converts the base number to string as you cant do string + integer.
  12.             if base > (int(end_no)):  # This is the number you want it to stop at.
  13.                 break # Gets us out of the infinite loop.
Advertisement
Add Comment
Please, Sign In to add comment