[OPGELOST] Hallo mensen, Ik ben beginner met een Scratch - Python boek. Ik typte onderstaand script uit m'n boek over. M'n inziens exact het zelfde. Maar toch krijg ik steeds dezelfde SyntaxError.
Wat gaat hier fout?
Shell:
Python 3.6.1, Thonny (Python IDE for beginners)
Wat gaat hier fout?
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| table = 7 for i in range(1, 13): print('What\'s', i, 'x', table, '?') guess = input() if guess == 'stop': break if guess == 'skip': print('Skipping') continue ans = i * table if int(guess) == ans: print('Correct!') else: print('No, it\'s', ans') print('Finished') |
Shell:
code:
1
2
3
4
5
6
7
8
| Python 3.6.1 >>> %Run 'blz 127 ontsnappingsloops.py' File "Z:\Medewerkers\Marco P\blz 127 ontsnappingsloops.py", line 14 print('No, it\'s', ans') ^ SyntaxError: EOL while scanning string literal >>> |
Python 3.6.1, Thonny (Python IDE for beginners)