0

Can any one corrcet it

h= int(input()) c= h* 200000 s = h* 300000 if ((s - c) +100000 >0: print ("Win") elif ((s - c) +100000) < 0: print ("Loss")

29th May 2022, 1:12 PM
Mohamad ali
3 Antworten
+ 4
you did not close the parenthesis on the if statement. if((s - c) + 100000 > 0: should be: if((s - c) + 100000) > 0: like you did on the else statement. But... your program have another problem. h=-1 will give no output because you don't have condition for ((s-c)+100000)==0
29th May 2022, 1:56 PM
Bob_Li
Bob_Li - avatar
+ 3
You have one extra bracket in line 5: if (s - c) + 100000 > 0: print('Win') elif (s - c) + 100000 < 0: print('Loss') Also for an improvement your code: dont forget that a number can be more, less and equals zero
29th May 2022, 1:58 PM
TriXioN
TriXioN - avatar
+ 2
TriXioN same conclusions, different method. 😅 also, I feel the extra 0's are redundant. Same result if he just used 1, 2 and 3 instead of 100000, 200000 and 300000.
29th May 2022, 2:00 PM
Bob_Li
Bob_Li - avatar