[Python] TypeError: unsupported operand type(s) for /: 'str' and 'str'

Discussão em 'Python' iniciado por Stack, Março 15, 2025.

  1. Stack

    Stack Membro Participativo

    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 I do to divide pyc by tpy?

    Continue reading...

Compartilhe esta Página