-2
我想我想要做的是從一個定義的列表中顯示一個選擇部分。目前,這是我與合作:斐波那契數列的計數程序Python
#fibonacci sequence algorithm, user stops by either
#entering a maximum Fibonacci value not to exceed or
#a total count that the sequence of numbers must not
#exceed. Use a loop that allows User to repeat program
#as much as they wish, asking if they would like to
#repeat the program each time. Validate that User input
#is either a yes or a no and only allow User to continue
#once a correct response has been given.
import array
array.listOfFibSeq = ['0','1','1','2','3','5','8','13','21','34','55','89','144','...']
startingNumber = ''
endingNumber = ''
continueYes = ''
def getStartingNumber():
print('Please enter a valid starting number of the Fibonacci Sequence')
print(listOfFibSeq)
startingNumber = input()
def getEndingNumber():
print('Please enter a valid ending number the the Fibonacci Sequence')
print(listOfFibSeq)
endingNumber = input()
我不確定如何去了解這一點,但我相信,我想在Fibonacci序列中通過89來顯示(例如)3或做某事如:
lsitOfFibSeq.remove(<3) and listOfFibSeq.remove(>89)
或者我應該嘗試顯示一個範圍的Fib序列與for循環?