open a python script editor and just paste the following code in your new python(.py or .pyw) file -
def fibonacciSeries ():
previous = -1
nextval = 1
position =9
for r in range(0,position):
sum = nextval + previous
previous = nextval
nextval = sum
print nextval
fibonacciSeries()
output is-
No comments:
Post a Comment