Getting Input

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

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

Note

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

Exercise

  • Ask yourself for a number

  • Try to convert the value you enter into a float