News for hackers. Stuff that matters.
Re:Python for Beginners by solox3 on Wednesday December 26, 2012 @03:04PM (#4970654)
All inline comments should come with a space after the #. All dictionary literals should have no spaces immediately within { and }. All multi-line dictionaries should be aligned one character after the opening parenthesis. There exists a line with "for key, value in dict.items.():", which is invalid. Use of one-liner "for" statements is discouraged. "if not a in b" is a more easily translatable statement than "if a not in b".
Re:Python for Beginners by spilcm on Saturday December 29, 2012 @05:54PM (#4983802)
Thanks solox3, are you referring to this line? ## .items() is the dict expressed as (key, value) tuples print dict.items() ## [('a', 'alpha'), ('o', 'omega'), ('g', 'gamma')]