Is it possible to have a user input equal to a variable for tasks that involve chemical elements.
For example, Carbon has the molecular mass 12, but i do not want the use to input 12, They should input 'C'. but as the input turns this into a string, it is not possible to lik this to the variable C = 12.
Is there any way to input a variable istead of a string?
If not, could i set a string as a variable.
example:
C = 12
element = input('element symbol:')
multiplier = input('how many?')
print(element*multiplier)
This just returns an error stating that you can't multiply by a string.