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 (oups)

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

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

When reading from the command line using input(), the resulting value is a string. Even if you only typed in digits. Therefore the addition operator + concatenates the strings.