Search code examples
user-interfacepython-idle

How to add a number and letter - python (letter is also number)


        print("How old are you")

        c = input()

        d = 1

The question is - how to add d + c together

Or how to add 1 + c together

I'm only a beginner and I've been at this for hours it's really confusing


Solution

  • If you mean c to be an input number ,then convert it to integer using int(c)

    So you have d + int(c)