[Python] How to have python do division using eariler numbers and print out a value [closed]

Discussão em 'Python' iniciado por Stack, Maio 1, 2025.

  1. Stack

    Stack Membro Participativo

    I'm new to python, and trying to figure out how to have it do some division in the end of my program.

    Eariler in the program, it asks the user for a number that can be divided by 20 as seen here:

    if int(Integer) % 20 == 0:
    True


    I then want later to have it take that number and divide it by 20. I figured I could do it using the following command:

    print(int(Integer // 20)

    However, I then get the following error message: TypeError: unsupported operand type(s) for //: 'str' and 'int'

    Is there another command I can use to have it do that division at the end and give me the output?

    Continue reading...

Compartilhe esta Página