+ 1
Write a program using list comprehension to print the Fibonacci sequence in comma separated form with a given n input by console
n=int(input()) mylist=[0,1] mylist=[mylist. append(mylist[-2]+[-1]) for n in range(n)] print(mylist)
4 ответов
+ 1
n=int(input())
mylist=[0,1]
mylist=[mylist. append(mylist[-2]+[-1]) for n in range(n)]
print(mylist).
0
This is my assignment. I don't know how to solve this! 😅