Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Add numbers entered by the user (fixed)

def main():
    a = input("First number: ")
    b = input("Second number: ")
    print(int(a) + int(b))
    print(a + b)


main()
First number: 2
Second number: 3
5

In order to convert the string to numbers use the int() or the float() functions. Whichever is appropriate in your situation.