Advertisement
Guest User

Untitled

a guest
Mar 6th, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. def molecuulformule(formule):
  2. alphanumeric = ''.join(e for e in formule if e.isalpha())
  3. index = 0
  4. dict = {}
  5. while index < len(alphanumeric):
  6. naam = alphanumeric[index]
  7. index += 1
  8. while index < len(alphanumeric) and not alphanumeric[index].isupper():
  9. naam += alphanumeric[index]
  10. index += 1
  11. if not naam in dict:
  12. dict[naam] = 0
  13. dict[naam] += 1
  14. return dict
  15.  
  16. def isomeren(formule1, formule2):
  17. if molecuulformule(formule1) == molecuulformule(formule2):
  18. return True
  19. else:
  20. return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement