Simple python Program



Hello friends, in this blog we see the actual code of python. To run the program of python you must install the python setup in the machine. You can download the setup of python from the python official site (www.python.org).

First, we see how to get input from the user and print output. The below program show how to print and store input data in a variable.

Program:

print("PYTHON PROGRAMMING")

a=input("ENTER YOUR NAME:")

print("HELLO",a)

In the above program ‘print’ keyword is used to print the data like print(“ PYTHON PROGRAMMING”). To store the data in any variable which is entered by the user we use keyword ‘input’ like a=input("ENTER YOUR NAME:"), if you enter your name like Alex then the Alex name is stored in the variable ‘a’.
            

The above image shows the actual code of python. To run python code save the code with the extension .py like xyz.py and to run this code press F5 function key or click on run button. When you run this program the python shell will appear like the below image.



           In the above image as per requirement, the PYTHON PROGRAMMING is printed then the next line is ENTER YOUR NAME and I enter ALEX and then pressed Enter key then the final output is like below image.


Friends if you have any doubts related to this post or any other post or any suggestions to me then write a comment in the comment box. Thank You.


Simple python Program Simple python Program Reviewed by Amit Waghmare on October 31, 2019 Rating: 5

No comments: