newbie needs help on dictionary

Olaf Appelt tholap at compuserve.com
Fri Dec 10 05:21:17 EST 1999


I'm new to Python so take this with moderate amounts of salt:

> count = turret[station][tool_name]
> count = count + 1
> turret[station][tool_name] = count

'count' is not a copy of 'turret[station][tool_name]', it's a reference.
So the following should result in the same thing:

> count = turret[station][tool_name]
> count = count + 1


Olaf






More information about the Python-list mailing list