NZEC error

x, y= map(float, input().split())
if x%5 == 0 and x < y :
y = y-x-0.5
print(str(y)+“0”)

HI, the IDLE is throwing NZEC error on the first line even simple statement is trowing NZEC error but on running with custom inputs the code is working fine . Can anyone help me with this error.

1 Like

You have not given indentation after if statement. Check this out

Thanks , but while writing code i gave but here i missed it.

Its because you are not providing any Input. Select custom input and input values of x and y

Hi,
When I am submitting the code it’s status is shown as incorrect and when I run the code with giving custom input it shows nzec error.

Your logic isn’t completely right. Consider the input: 5 5.10. Your code will output a negative number which is incorrect.
Also use '{:.2f}'.format(y) instead of str(y)+'0' while printing.