This is what they have:
def fib(n):
a, b = 0, 1
while a < n:
print a,
a, b = b, a+b
This is what I have:
def fib(n):
a = 0
b = 1
while a < n:
print a
a = b
b = b+a
The first returns the correct sequence when employed, whereas mine proceeds 0, 1, 2, 4, 8, 16, 32...
I am currently learning programming (no prior computer science education), and it's clear that the problem is how I've defined my variables. What is the difference between separating the variables by commas and separating variables by a new line (assuming that is the issue)?