anonymous
  • anonymous
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')
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
chestercat
  • chestercat
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
The y in your call to print should not be in quotes unless you literally want to print the string 'y'.
anonymous
  • anonymous
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
anonymous
  • anonymous
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.

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
I submit ... and your original answer solved the problem

Looking for something else?

Not the answer you are looking for? Search for more explanations.