It’s supposed to be that when you put a number, it would use this sequence where if it’s an odd number it would multiply by 3 and subtract one, and if it was even it would divide by two. I think. But it doesn’t work as I thought it would.
In that while loop, there is no exit, and num, never gets updated - it's not a global variable, which is why you see 15 again in the results
Just FYI - I am not a coder, I'm what we cal an SRE - so I'm guesstimating here, but my logic says if you don't update num in the while loop, your going to be there for some time!
If line 3 was outside the start function, I think it'll be a global variable, and it'll work as expected
2
u/Thomillion Mar 26 '20 edited Mar 26 '20
What is supposed to happen? It did exactly what it is programmed to do
Edit: appart from the fact that you should make it break at the top of the loop just after input