1
  • When I do: print(()) it gives output: ()

  • When I do: print(('abhay', 'bhatt')) it gives output: (abhay, bhatt)

  • But, when I do: print(('abhay')) it gives output: abhay

(ie without parentheses)

Can someone explain this behaviour?

Thanks

azro
  • 53,056
  • 7
  • 34
  • 70
  • `('abhay')` just evaluates to `'abhay'` which means consider as ``. If you want to create `tuple` with consist of only one item add a comma after the item just like `('abhay',)` – mohammed wazeem Mar 26 '20 at 13:15

0 Answers0