I want to know that why adding a trailing comma after a variable name (in this case a string) makes it a tuple
. i.e.
>>> abc = \'mystr
It is the commas, not the parentheses, which are significant. The Python tutorial says:
A tuple consists of a number of values separated by commas
Parentheses are used for disambiguation in other places where commas are used, for example, enabling you to nest or enter a tuple as part of an argument list.
See the Python Tutorial section on Tuples and Sequences