Computer Science
What will be output produced by following code? State reason for this output.
a, b, c = 1, 1, 2
d = a + b
e = 1.0
f = 1.0
g = 2.0
h = e + f
print(c == d)
print(c is d)
print(g == h)
print(g is h)
Python
Python Data Handling
45 Likes
Answer
True
True
True
False
Working
Value of d becomes 2 and as values of c and d are equal so print(c == d) prints True.
Answered By
19 Likes
Related Questions
What will be output produced by following code? State reason for this output.
a = 5 - 4 - 3 b = 323 print(a) print(b)
What will be output produced by following code? State reason for this output.
a, b, c = 1, 1, 1 d = 0.3 e=a+b+c-d f=a+b+c == d print(e) print(f)
What will following code print?
a = 3 b = 3.0 print (a == b) print (a is b)
What will following code print?
a = va = 3 b = va = 3 print (a, b)