4.Taking Input From the User in Python
4.Taking Input From the User in Python
input( )
The input( ) function allows user input.
For example,
The code below takes String input from the user. String is a sequence of
characters.
As we have seen in the above example that when we receive the input using
input() function in the form of String. To convert the string input to integer we
use the int() function with the input( ) function.
In the similar way, we can also accept float values (decimal values) by using
float( ) function with the input( ) function.
s = first_num + second_num
As you know variables are like containers for storing values (data).
****************************