Commit 50a57e3e authored by Bhagawat Acharya's avatar Bhagawat Acharya

Upload New File

parent c37c1241
import re
def compare_Equations(equation1, equation2):
equation1 = "".join(equation1.split())
equation2 = "".join(equation2.split())
eq1 = equation1.split('=')
eq2 = equation2.split('=')
eq1list = []
eq2list = []
for side in eq1:
eq1list.append(sorted(re.split('[-|+|*|/]',side)))
for side in eq2:
eq2list.append(sorted(re.split('[-|+|*|/]',side)))
print(eq1list,eq2list)
return eq1list==eq2list
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment