Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def molecuulformule(formule):
- alphanumeric = ''.join(e for e in formule if e.isalpha())
- index = 0
- dict = {}
- while index < len(alphanumeric):
- naam = alphanumeric[index]
- index += 1
- while index < len(alphanumeric) and not alphanumeric[index].isupper():
- naam += alphanumeric[index]
- index += 1
- if not naam in dict:
- dict[naam] = 0
- dict[naam] += 1
- return dict
- def isomeren(formule1, formule2):
- if molecuulformule(formule1) == molecuulformule(formule2):
- return True
- else:
- return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement