#!/usr/bin/python3 def main(): #This is the main function for the important section of the program Nuser = int(input("What terms would you like?")) #This asks the user to type in any terms that they want N1 = 1 #created the Integer variable "N1" and had it equal to 1 N2 = 0 #created the Integer variable "N2" and made it equal to 0 Ncount = 1 #created the variable "Ncount" and made it also equal to 1 NHold = 0 #Created the variable "NHold" and made it also equal to 0 Nlist =  #Created a list thats soon to be appended while Ncount <= Nuser: #This is a statement for when Ncount is less than or equal to the Nuser's terms Nlist.append(N1) #Appends the first number to a list NHold = N1 + N2 #Makes NHold equal the sum of N1 and N2 N1 = N2 #N1 is now equal to N2 N2 = NHold #copy N2 to Nhold Ncount += 1 #Increase the value of Ncount print(Nlist) GoAgain() #This is the ending sequence def GoAgain(): #This will create a function that will ask the user whether they want to go again or not print("Go Again? Y or N") answer = input("==>") if answer == "Y" or answer == "y": #If the user types "y" it will go back to the main function and restart the program main() elif answer == "N" or answer == "n": #If the user types "n" it will end the program and say a goodbye message print("Have a nice day!") else: #If the user types anything other than the two options above it will restart the GoAgain function GoAgain() main() #resets the main function
What terms would you like?7 [1, 0, 1, 1, 2, 3, 5] Go Again? Y or N ==>n Have a nice day!