+ 1
Help me. Python.
This code works BUT....BUT every time the output is “profit”. Even when it has to be “loss”. I don’t know why. https://code.sololearn.com/cC1j8cPY8VmY/?ref=app Thank you very much for your help.
3 Respuestas
+ 3
compare the number as int. not str
also you need print inside else
+ 3
n = 2100000
num = int(input())
total = num*300000
if total>n:
print("Profit")
elif total<n:
print("Loss")
else:
print("Broke Even")
+ 1