sathvikveligatla
New Coder
hi,
I am learning python, and when I am trying practice exercises I came across the following question:
this is the code I tried:
I don't understand where i went wrong. the problem is it show only the product in any case.
Any help?
Thanks
I am learning python, and when I am trying practice exercises I came across the following question:
Given a two integer numbers return their product and if the product is greater than 1000, then return their sum.
this is the code I tried:
Python:
while True:
x=input('no 1')
y=input('no 2')
z = x*y
if z >> 1000 == True:
print(x+y)
else:
print(x*y)
I don't understand where i went wrong. the problem is it show only the product in any case.
Any help?
Thanks
Last edited by a moderator: