Trezor
April 30, 2019, 11:31am
#1
So I am getting this:
File "C:\Users\John\LPTHW\ex43.py", line 185
'central_corridor': CentralCorridor(),
^
SyntaxError: invalid syntax
I get it even if I copy the code from the book.
This is my code:
class Map(object):
scenes = [
'central_corridor': CentralCorridor(),
'laser_weapon_armory': LaserWeaponArmory(),
'the_bridge': TheBridge(),
'escape_pod': EscapePod(),
'death': Death(
]
Hi @Trezor .
You have used wrong brackets for the dictionary.
A dictionary uses “{ }” brackets.
The " [ ] " is for lists.
Correct this and put a closing bracket “)” on the Death class it should work fine.
Trezor
April 30, 2019, 11:40am
#3
Hi ulfen69
Of course! Thanks. The error is present in the book as well.
Perhaps you can tell Zed about this. I think he had some issues with printing the books.
Maybe he want to know how many books with this errors that actually was printed.
That would be a very old printing mistake of the book. Where did you get this book? A library?