Getting Input

Most programs want to take some raw_input() to produce some output:

>>> raw_input( 'What is your number: ' )
'32'
>>> number = raw_input( 'What is your number: ' )
>>> number
'32'

Note

If you are using Python 3.x you need to use input() instead of raw_input().

Exercise

  • Ask yourself for a number
  • Try to convert the value you enter into a float