[Tutor] creating dictionary from a list
Mark Lawrence
breamoreboy at yahoo.co.uk
Sat Apr 13 21:08:13 CEST 2013
On 13/04/2013 19:45, Saad Javed wrote:
>
> for item in lst:
> if
>
> item.startswith(('Mon','Tue','____Wed','Thu','Fri','Sat','Sun'__))__:
> myDict[item] = []
> saveItem = item
> else:
> myDict[saveItem].append(item.____strip())
>
> Returns:
> File "gcalcli_agenda_test.py", line 38
> if item.startswith(('Mon','Tue','__Wed','Thu','Fri','Sat','Sun'))__:
> ^
> SyntaxError: invalid syntax
>
Please compare your original line with the line above and note the
differences. That'll account for the syntax error, which appears to
have been introduced by your email client.
--
If you're using GoogleCrap™ please read this
http://wiki.python.org/moin/GoogleGroupsPython.
Mark Lawrence
More information about the Tutor
mailing list