+ 1
Why do these two codes produce different outputs ?
code1: print(type (2,)) code2: c = 2, print(type (c)) First code gives Integer while second gives Tuple.
1 ответ
+ 2
hi,
class type(name, base, dict)
base and dict are optionals
when name = 2, => type return the name's type : integer
when c=2, => you declare a variable c like tuple
so type (c) = tuple