NZEC ERROR - ATM - PYTHON

HELLO ,
this is my code
b, t = input().split(" ")
b = float(b)
t = float(t)
if t < b + 0.5 and (t % 5 == 0):
b = b - (t + 0.5)
print(“your current balance”, “%.2f” % b)
else:
print(“your balance”, b)

i don’t understand where is the problem in this situation
thank you for your help

Please give the link to your question.

Edit: I found the question.
Remove that " your current balance" and “your balance” from if else statements.
Use these:-
print("%.2f"%b) # for if
print("%.2f"%t) # for else

2 Likes

thank for your answer
i tried it but i doesn’t work
updated code :
b, t = input().split(" ")
b = float(b)
t = float(t)

if t < b + 0.5 and (t % 5 == 0):
b = b - (t + 0.5)
print("%.2f" % b)
else:
print("%.2f"%t)

I did some changes. Hopefully this one will work.

b , t = map(float , input().split())
if (b+0.5 )<t:

if b%5 != 0:
    print(t)
else:
    z = t-b-0.50
    print("%.2f"%z)

else:
print("%.2f"%t)

1 Like

unfortunately it doesn’t
there is something we are missing

thank you for your efforts really appreciated

I just checked it bro. It’s working.
Don’t run the code. Just press the submit button. And don’t forget to give the proper identations.

1 Like

it did , thnx i understand now