python - How can you divide an input answer? -
im making calculator finds average of persons test scores eg: 16/20 + 17/20/2 im having trouble figuring out how divide users marks eg: if person enters 18/20, how divide it?
you split up:
numerator, denominator = '18/20'.split('/') decimal = float(numerator) / float(denominator)
Comments
Post a Comment