Back
name = input('Enter name here:')pyc = input('enter pyc :')tpy = input('enter tpy:')percent = (pyc / tpy) * 100;print (percent)input('press enter to quit')
whenever i run this program i get this
TypeError: unsupported operand type(s) for /: 'str' and 'str'
what can iido to divide pyc by tpy?
You can divide pyc by tpy by turning them into integers instead:
percent = (int(pyc) / int(tpy)) * 100;
For python3 the input() function always returns a string.
31k questions
32.8k answers
501 comments
693 users