📅 2012-Apr-24 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ python, tuple ⬩ 📚 Archive
# Empty tuple
= ()
t = tuple()
t
# Tuple with one item
= (99,)
t = ("snake",)
t = tuple([99])
t = tuple(["snake"])
t
# Tuple with many items
= (99,"snake")
t = tuple([99,"snake"])
t
# Tuple with nested items
= ((99,100),"snake")
t
# Works in many places, *not* everywhere
= 99,
t = 99, "snake" t
Tried with: Python 3.2.2