0
a = (1)
b = ('y')

The output of type(a) is int, isn't it supposed to be a tuple? Similarly, type(b) is str.

How does this make it an int or str or float etc for the single value inside the round brackets?

Dimitris Fasarakis Hilliard
  • 150,925
  • 31
  • 268
  • 253
sans0909
  • 395
  • 7
  • 20

1 Answers1

0

That's because you do not have the correct syntax of a one-element tuple:

type((1)) # int
type((1,)) # tuple
DainDwarf
  • 1,651
  • 10
  • 19