+ 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.

19th May 2017, 11:35 AM
bibash sapkota
bibash sapkota - avatar
1 Resposta
+ 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
19th May 2017, 12:56 PM
MBZH31
MBZH31 - avatar