CBSE Class 11 Computer Science Question 59 of 114

Tuples — Question 11

Back to all questions
11
Question

Question 11

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