# KeyboardInput.py # Charles Van Loan # January 1, 2015 """ Compares the input and raw_input functions """ # With the input function, the response is either a number of a string enclosed # in quotes. x = input('Enter a number: ') y = x+x print x, y s = input('Enter a string in quotes: ') t = s+s print s,t # With raw_input, the response is neve in quotes and the result # is always a string s = raw_input('Enter a string with no quotes: ') t = s+s print s,t # If the input "quoteless" string encdes a number, you have to # convert it to a numerical type if you intend to use it in an # arithmetic expression x = raw_input('Enter something like 12.345 :') x = float(x) y = x+x print x,y