Help with dictionary, please

Klaus Alexander Seistrup kas at maps.magnetic-ink.dk
Fri Aug 6 08:51:09 EDT 1999


Rob Lake writes:

> 	 	   key = (prev2,prev1)
> 	           dict[key] = dict[key] + 1
>    and got this error:
> 	  File "Metro:Python 1.5.1:learn2.py", line 34
>           dict[key] = dict[key] + 1
>                          ^
> 	SyntaxError: invalid token

The variable key should be a string, you're supplying a tupple.


  //Klaus

-- 
···[ Magnetic Ink ]················································· ><> ···
···[ http://www.magnetic-ink.dk/download/ ]·································




More information about the Python-list mailing list