Advertisement
Guest User

Untitled

a guest
Jan 20th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. def calculateMolecularWeight() :
  2.     Compound = userinput.get()
  3.     tokens = re.findall(r'[A-Z][a-z]*|\d+|\(|\)', Compound)
  4.     displayNoOfElements(tokens)
  5.     lblTotal = tk.Label(root, text = ' The Molar mass: ' + str(Compound) + ' is ' + str(round(parse(tokens, []),4)) + ' g/mol .').grid(row = 4, column = 1, padx = 0,pady = 10)
  6.     print(mylist)
  7.     mylist.clear()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement