stupefy developer
blog about software development, *nix and anything that is related to that
Friday, September 12, 2008
python: tuple with one item
When you want to construct a tuple containing only one item you should write
variable = (1,)
You have to
add extra coma after the item
. If you forget this coma the item will be returned, not the tuple.
Weird =/
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment