Quantcast
Channel: BlogoSfera » comma
Viewing all articles
Browse latest Browse all 12

Why is "tuple([0])" printed as "(0, )"?

$
0
0

While converting lists to tuples in python 2, I noticed that converting any list with a single item to a tuple produces a comma after the item. >>> tuple([0]) (0,) >>> tuple(['i']) ('i',) What is the reason for the comma being shown? Does it cause any unexpected behaviour other than how it is printed? I […]

The post Why is "tuple([0])" printed as "(0, )"? appeared first on BlogoSfera.


Viewing all articles
Browse latest Browse all 12

Trending Articles