What is the difference between (30) and (30,) ?
25 Likes
a = (30) ⇒ It will be treated as an integer expression, hence a stores an integer 30, not a tuple.a = (30,) ⇒ It is considered as single element tuple since a comma is added after the element to convert it into a tuple.
Answered By
12 Likes
How can you add an extra element to a tuple ?
When would you prefer tuples over lists ?
When would sum( ) not work for tuples ?
Do min( ), max( ) always work for tuples ?