def fib(n):
a = 0
b = 1
if n == 1:
print(a)
else:
print(a)
print(b)
for i in range(2,n):
c = a + b
a = b
b = c
print(c)
fib(int(input()))
how do i make it so the output comes in a single line attached one result to another instead of receiving one sum below the other
simple append/join commands that didn't work, most likely i don't know how to properly use them in this instance your text
source https://stackoverflow.com/questions/75513181/merge-attach-join-put-together-fibonacci-output-lines-into-a-single-line
Comments
Post a Comment