0

I am currently learning Python using Jason Briggs' book. I tried entering some code from the book into the IDLE shell and getting a "multiple statement error" message. I've even deleted and re-inserted 4 spaces in all the lines of code.

I have had this issue before, but couldn't find out how to solve it. I searched online, but I don't think I have an indentation or coding error.

I'm using IDLE 34 on Windows Professional 7. This is what I typed into the IDLE shell:

found_coins = 20
magic_coins = 70
stolen_coins = 3
coins = found_coins
for week in range(1, 53):
    coins = coins + magic_coins - stolen_coins
    print('Week %s = %s' % (week, coins))
**Click Enter** 

The error I get is:

SyntaxError: multiple statements found while compiling a single statement
Michael0x2a
  • 58,192
  • 30
  • 175
  • 224
  • possible duplicate of [Please help. Multiple statements found while compiling a single statement](http://stackoverflow.com/questions/18771573/please-help-multiple-statements-found-while-compiling-a-single-statement) – Nir Alfasi Sep 07 '14 at 16:43
  • Have you copied and pasted it? It should work if you properly type it clicking enter after every line – user3725459 Sep 07 '14 at 17:14
  • If you have typed that `**Click Enter**` too, it's no wonder you get a syntax error. – Oberon Sep 07 '14 at 19:32
  • Haha. I didn't. I wanted to show all keyboard actions. Sorry. Is it better to post a screenshot? – arijjan verboon Sep 09 '14 at 17:55
  • Well,well. Another day, another attempt. This time it works fine. The reason I posted, it was not the first time. I will investigate this further and see if anything worth sharing comes up.Thks for your time and efforts. ArijJan – arijjan verboon Sep 10 '14 at 06:57

0 Answers0