I was first getting wrong answer and after adding the edge conditions I am getting runtime error
withdraw,balance = map(float,input().split(" “))
if 0<withdraw<=2000 and 0<=balance<=2000:
if withdraw%5==0 and balance>(withdraw+0.5):
b=balance-withdraw-0.5
print (”%.2f" %b)
else:
print ("%.2f" %balance)
Please help
To remove NZEC you can use try and except method in python
For Example:
try:
# your code
except:
pass
x,y = map(float,input().strip().split())
if x%5 != 0:
print("{:.2f}".format(y))
else:
if x>y:
print("{:.2f}".format(y))
else:
if y - x >=.5:
y = y -x - .5
print("{:.2f}".format(y))
else:
print("{:.2f}".format(y))
I suggest going through this above AC Code to understand, what might be the reason why you were getting errors.