tags:

views:

285

answers:

2

Tell us your "WTF?" moments when lerning or experimenting with Python as well as reading someone else's Python code!

A: 

I think many beginners would have thought (1) was a tuple consisting of 1, only to find that it's just 1 thinking WTF:

>>> beginners_tuple = (1)
>>> beginners_tuple
1
>>> actually = (1,)
>>> actually
(1,)
OTZ
A: 

When I first saw list comprehensions.

Aaron Digulla