Extra Topic: Console Input


Note: extra topics are not in CS Academy, but are required and can appear on any future homework, writing session, quiz, or exam.
Input a string:

name = input('Enter your name: ') print(f'Your name is {name}.')

Input a number (error!):

x = input('Enter an integer: ') print(f'{x}/2 == {x/2}') # Error!

Input a number with int():

x = int(input('Enter an integer: ')) print(f'{x}/2 == {x/2}') # Works, but only for integer inputs