1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Why am I getting “TypeError: unsupported operand type(s)” in Python? [duplicate]

Discussão em 'Python' iniciado por Stack, Novembro 28, 2025.

  1. Stack

    Stack Membro Participativo

    I am a beginner learning Python.
    When I try to add two numbers taken from input(), I get this error:

    a = input("Enter number: ")

    b = input("Enter number: ")

    print(a + b)

    Instead of adding them, Python joins them as strings (like “10” + “20” → “1020”).
    How can I fix this and correctly add the numbers?

    Continue reading...

Compartilhe esta Página