#/usr/bin/env python3
def main():
############################
# #
# Variable Declarations #
# #
############################
fibOne = 0 #First Value in the sequence
fibTwo = 1 #second value in the sequence
fibOneList = [] #Blank array that will hold all of the values
fibTerms = int(input("Enter an integer => ")) #an input that will define the length of the sequance
############################
# #
# while loop procedure #
# #
############################
for count in range(0, fibTerms):
#for loop starts at zero and continues until inputted item is reached
fibOneList.append(fibOne) #fibOne gets added to list
holder = fibOne + fibTwo #holder variable is created and sums fibOne and fibTwo
fibOne = fibTwo #fibOne takes the value of fibTwo
fibTwo = holder #fibTwo take the value of fibOne
count += 1 #The value of count is increased by one
print("here is a fibonacci sequence of {} numbers starting at 0".format(fibTerms))
print( ", ".join(repr(item) for item in fibOneList ))
#I print out the array in a readable format, by printing each value in
#the array, and joining it as a single string. It uses the .join()
#method. and the repr() built in function. repr() takes data and puts it
#in a readable format. The for loop inside the repr function goes through
#each item of the list that was created.
endgame() #I call the endgame function
def endgame():
print("Go again? Y or N")
answer = input("==> ") #input asking to go again.
if answer == "Y" or answer == "y": # if yes I rerun the main() function
main()
elif answer == "N" or answer == "n": #if no I print have a nice day and leave
print("have a nice day")
else: #if it's not a 'y', 'Y', 'n', or 'N' I rerun the function
endgame()
main() #I start the program withe the main function