CBSE Class 12 Computer Science Question 64 of 105

Python Revision Tour II — Question 13

Back to all questions
13
Question

Question 13

What is the difference between (30) and (30,) ?

Answer

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.

Answer