Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def tribonachi ():
- num = [0, 0, 1]
- for i in range(2, int(input()) + 1):
- num.append(num[i] + num[i - 1] + num[i - 2])
- while 0 in num: num.remove(0)
- return num
- print(*tribonachi())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement