I am printing the list variable as:
lst=("Python",)*3
print(lst)
lst=("Python")*3
print(lst)
and the output is
('Python', 'Python', 'Python')
PythonPythonPython
Definitely the output is different due to the comma(,) used in the first print statement. But the first statement does not have two values either.
Can someone describe the technical reason behind this?
("Python",)creates a 1-tuple and("Python")is just a string in brackets. In fact, the brackets don't do anything here, just"Python",will create the same tuple. As a side note,()will create an empty tuple.("1", "2") * 2=("1", "2", "1", "2")