ATM , Python Code Throwing runtime Error

Hi All,

This is my code it’s throwing runtime error in online judge but working fine in my PC
Using python 2.7

def atm(x,Y):
if x % 5 != 0 or Y-x < 0.50: 
	print  '%f' % Y 
else:
	print '%f' % (Y-x-0.50) 

a = input()
b = input()

atm(a,b)

You need to read both number a and b in the same line
I would counsel you to use ‘a,b = raw_input().split()’
and then do the cast to integer and float as needed

1 Like