Runtime Error (NZEC) python

Question :HS08TEST Problem - CodeChef
Solution:
x, y =map(float, input().split())
if x%5 != 0 or x>y-0.50 :
print(‘%.2f’%y)
else :
print(str(‘%.2f’%y-x-0.50)+" ",str(‘%.2f’%y))
Cant figure out why I get the error

Seems like you’re new to python uh!
Your print statements are causing the error due to wrong syntax (try using the custom input by either copy pasting the sample test cases or writing your own test cases to debug your code).

This is my solution (correct code) for the problem (observe how i have printed the float values):

x,y=map(float,input().split())

if (x%5==0 and (x+0.50)<y):
    c=(y-x)-0.5
    print("{0:0.2f}".format(c))
else:
    print("{0:0.2f}".format(y))
1 Like