Input Output in Python

Python provides numerous built-in functions that are readily available to us at the Python prompt.

Some of the functions like input() and print() are widely used for standard input and output operations respectively

We use the print() function to output data to the standard output device (screen).

By using Input function we can accept input from standard input device ie Keyboard.

When we want to print anything on screen we use print() function

print("Demonstration of Print Function")#Output:- Demonstration of Print Function 

Similarly when you want to get any input from user we use input() function:-

#we take input using input() function
X=input("Enter the Number\n")
#you can write string inside input function if you want

In the above code snippet we have taken input from user and stored that input into variable.

Variable is a container which holds data.

We will Discuss about variable and rules for variables in details in next section.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store