Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def tribonacci(num):
- tribonacci_list = [1]
- for i in range(num - 1):
- new_element = sum(tribonacci_list[-1:-4:-1])
- tribonacci_list.append(new_element)
- return tribonacci_list
- number = int(input())
- print(*tribonacci(number))
Add Comment
Please, Sign In to add comment