Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- list = [0, 1]
- i = 0
- if n == 1:
- print(list[:1])
- elif n == 2:
- print(list[:2])
- else:
- a = list[0]
- b = list[1]
- while i < n - 2:
- c = a + b
- list.append(c)
- a = b
- b = c
- i += 1
- print(list)
Add Comment
Please, Sign In to add comment