Parse variables
This commit is contained in:
parent
118519bb41
commit
16e54a9b13
|
@ -0,0 +1,8 @@
|
|||
AVOGADROS_CONSTANT = 6.022e23
|
||||
|
||||
substance = input('Si et stoff du er i besittelse av: ')
|
||||
weight = float(input('Hva er molvekt i gram for vann? '))
|
||||
amount = float(input('Hvor mange gram vann har du? '))
|
||||
|
||||
numberOfMolecules = (amount * AVOGADROS_CONSTANT / weight)
|
||||
print(f'Du har {format(numberOfMolecules, ".1e")} molekyler {substance.lower()}')
|
Loading…
Reference in New Issue