1.

What type of data is accepted by input function in python.PLEASE GIVE A GENUINE ANSWERCLASS 11th

Answer»

In Python, we have the following TWO functions to handle INPUT from a user and system.

input(PROMPT) to accept input from a user.
print() to display output on the console.
Python 3 has a built-in function input() to accept user input.

In Python 2, to accept user input we can use the following two functions: –

input([prompt])
raw_input([prompt])
The input() function reads a line entered on a console by an input device such as a keyboard and convert it into a string and returns it. As a new developer, It is essential to understand what is input in Python.

What is the input?

The Input is nothing but some value from a system or user. For example, if you want to perform an addition of two numbers on the calculator you need to provide two number to the calculator, those two number is nothing but an input provided by the user to a calculator program.

There are different types of Input, and that comes in various ways. For example: –

Input stems from the keyboard. i.e., the user entered some value using a keyboard.
Input Using Mouse Click or movement, i.e. you clicked on the radio button or some drop-down list and chosen an option from it.
In Python, there are various ways for reading input from the user from the COMMAND line environment or through the user interface. In both cases, the user is sending input from Keyboard or mouse.



Discussion

No Comment Found