0
Another question about how we got this output in Python
Input: a = range(1,7,2) if(a[1] == 3): print(int(type(a)==list), end= 'n') print(sum(a)) output: 0n9
5 Respuestas
+ 2
since the condition in the if is true, it prints out a boolean that checks if a is a list, which it isn't, followed by the "n". then it prints out the sum, which is 1 + 3 + 5 = 9
+ 1
so int(false) is equal to 0? Does that always hold as true?
+ 1
perfect. Thank you so much! I understand this now :)
+ 1
Yes