1
invalid syntax
GustavW (1)

Hi everyone.
I get "invalid syntax" on this:
for i in range(1, n)
print (t[i], F[i])
..where t, F and n of course are defined. Why the error message?

You are viewing a single comment. View All
2
JustARatherRidi (185)

Currently, the SyntaxError being raised in your repl is because you've left out a closing parenthesis on line 28. So line 28 should look like:

F[i]=F[i-1]+dt*(-k3*F[i-1]+k4*R[i-1]*F[i-1])

Change that, and the code seems to be working fine.

2
GustavW (1)

@JustARatherRidi
Yeah I wrote that expression "unfactorized", and then it worked. Of course it was something stupid like that. Thanks for checking the code!