Website developed/managed by prakhar thapak
Following is the python code that works good for the problem
Rishabh jain 6.4
ABSYS |
Following is the python code that works good for the problem
tst = int(raw_input())
to_find="machula"
for i in range(tst):
r=raw_input()
t=raw_input()
index=t.find(to_find)
if (index+6)!=(len(t)-1):
t=t[:index] + "12" +t[index+7:]
else:
t=t[:index] + "12"
equal_to=t.find("=")
plus=t.find("+")
s=t.split(" ")
number1=int(s[0])
number2=int(s[2])
number3=int(s[4])
if index<plus:
number1=number3-number2
elif index>equal_to:
number3=number1+number2
else:
number2=number3-number1
print str(number1),"+",str(number2),"=",str(number3)
Rishabh jain 6.4
0 comments:
Post a Comment