Created
January 14, 2023 06:29
-
-
Save niranjandasMM/f70fefaa2eb333e769b9b4201573cab0 to your computer and use it in GitHub Desktop.
Python3 | Using a Data structure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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