I am on lecture 2 (6.00) and using Python 3x. I am having problem with the following code. I type the same thing as the lecture but apparently i got the printout as y instead of 9. can anyone explain? y=0 x=3 itersLeft=x while (itersLeft>0): y=y+x itersLeft=itersLeft - 1 print ('y')
The y in your call to print should not be in quotes unless you literally want to print the string 'y'.
somewhere in the course instructions they said NOT to use Python 3.x because it is not backwards compatible and some of the example code won't work
Yes, that's true, However, nearly everything will work except print, so if you're fine with making the necessary adjustments you can get away with using 3 if you really want to.
I submit ... and your original answer solved the problem
Join our real-time social learning platform and learn together with your friends!