- 1
Different output to apparently same code
https://code.sololearn.com/cmn4v5j1yrdL/?ref=app https://code.sololearn.com/caOk7j8QYV7o/?ref=app The only difference is that in one code I used commas to separate variables and in the other i used a different linea, but I thought it was the same thing? In case it isn't can you please tell me what's the difference?
1 Answer
0
The logic in the first one is wrong, it wont output the fibonnaci sequence.
The thing with the commas:
It's possible in Python to assign variables multiple ways, the first one being the normal way, that goes like:
a = 1
b = 3
And the second one:
a, b = 1, 3
Both will give you the same result