+ 1
Wondering how to write fibbonachi sequence with what we have learned so far... I understand this is more of a math question
Still very curious
7 Antworten
+ 10
Well done, indeed. You can assign it like this:
x, y = y, x + y
and you don't need n then :)
+ 9
it's math questions like this and fizzbuzz that'll make me fail interviews, not because I can't code it, but because I don't understand math in general
:c
+ 6
x = 1
y = 1
while x <=100 and y <=100:
print(y + x)
n = x + y
x = y
y = n
did it! The problem was the x and y variables changed if I just wrote x = y and y = x + y. I had to assign n and it works
+ 3
Have you tried writing any code yet? We would be glad to help if you could show any work you've done so far.
+ 2
Well done!
+ 1
Thanks got all the support guys. I'm 15 and I started programming for the problem-solving aspect. Can't wait to learn more.