Skip to content

Instantly share code, notes, and snippets.

@niranjandasMM
Created January 14, 2023 06:29
Show Gist options
  • Save niranjandasMM/f70fefaa2eb333e769b9b4201573cab0 to your computer and use it in GitHub Desktop.
Save niranjandasMM/f70fefaa2eb333e769b9b4201573cab0 to your computer and use it in GitHub Desktop.
Python3 | Using a Data structure
# We all know the Series starts with 0 and 1
temp = [0,1] # you can change to [1,1], [20,21] anything , first 2 values should be there
# then we are just adding the 1st ith and 2nd ith but plus 1
[ temp.append( temp[i]+ temp[i+1] ) for i in range(10) ]
print(temp)
#----------------------output-----------------------#
# [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment