While trying to create fabianski sequence..the second one aint working..can't find out y..šŸ˜•šŸ˜• | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

While trying to create fabianski sequence..the second one aint working..can't find out y..šŸ˜•šŸ˜•

https://code.sololearn.com/c1GHh7LYh7ot/?ref=app

11th Aug 2019, 7:53 AM
Y AD ƙ
Y AD ƙ - avatar
4 Respostas
+ 2
It's because of lines 20-21. Do it like this: c,d = d,c+d
11th Aug 2019, 11:38 AM
Diego
Diego - avatar
+ 1
In your code, "d = c+d" uses "c = d" (because it's executed first), so line 21 is basically doing " d = d + d". If you put it all in one line, the RHS is evaluated first (using the old values for "c" and "d") and then gets assigned to the LHS.
11th Aug 2019, 1:40 PM
Diego
Diego - avatar
+ 1
Cleared..thnks for the explanation Diego šŸ˜„
11th Aug 2019, 5:26 PM
Y AD ƙ
Y AD ƙ - avatar
0
What's the difference Diego ..?
11th Aug 2019, 12:23 PM
Y AD ƙ
Y AD ƙ - avatar