Computer Applications
To convert input received via input( ) of Python 2.x in a numeric type, which of the given functions can be used ?
- convert( )
- float( )
- int( )
- No conversion required as input in already in desired form.
Python Funda
1 Like
Answer
No conversion required as input in already in desired form.
Reason — The input() evaluates the given input and returns the value accordingly. Thus, no conversion is required as input in already in desired form.
Answered By
3 Likes
Related Questions
Which of the following functions will you use to find out the type of a variable ?
- datatype( )
- type( )
- typeof( )
- dtype( )
To convert input received via raw_input( ) of Python 2.x in a numeric type, which of the given functions can be used ?
- convert( )
- float( )
- int( )
- No conversion required as input is already in desired form.
How are floating constants represented in Python ? Give examples to support your answer.
How are string-literals represented and implemented in Python ?