Ticker

6/recent/ticker-posts

User input in Python

 User input in Python:

The programmers often have to interact with the user either to get input or to provide the result. Python has inbuilt functions to get the input from the user and to show the result.

Input using input ( ) function in Python:

To get the information from the user through the keyboard input ( ) function is used. Python stops the program wherever input ( ) function is used, and it continues only after it gets the input from the user. The user has to type the input and press enter to continue the program. 

 

Input in Python

The input received through this function will be converted into a string. To convert the string into integer we have to use int (input( )). To convert the string into float we have to use float (input( )). 

 

Coverting string input into integer and float

Output using print ( ) function in Python:

To view the output or result on the screen print ( ) function is used.

 

Print function in Python


Post a Comment

0 Comments