+ 2

Why we can't type comma separated integer value in Python

I tried to print r =1,000,000 but value printed in binary like [1,0,0].. https://code.sololearn.com/cPZxfz93iklK/?ref=app

15th Jul 2017, 2:59 AM
Somasundaram R
Somasundaram R - avatar
1 ответ
+ 1
in python when you put interger with commas it takes that as a tuple. tuple can be declared without open braces ()... so if you decalred a = 1,2,3 its same as a = (1,2,3) so there is no need to put comma if you are not declaring a tuple and declaring a normal integer
15th Jul 2017, 8:48 AM
J Prak
J Prak - avatar