KnowledgeBoat Logo
|

Computer Applications

To convert input received via raw_input( ) of Python 2.x in a numeric type, which of the given functions can be used ?

  1. convert( )
  2. float( )
  3. int( )
  4. No conversion required as input is already in desired form.

Python Funda

2 Likes

Answer

float( ) and int( )

Reason — Python offers float( ) and int( ) functions to be used with rawinput() to convert the values received through rawinput() into integer and float types.

Answered By

1 Like


Related Questions