print("Hello, World!")
You can run this program by saving it to a file with the ".py" extension (e.g. "hello.py") and running it using the Python interpreter. On command prompt or terminal, navigate to the directory where the file is saved and type python hello.py and press enter.
Alternatively, you can also write your python code directly in the command prompt or terminal by typing python and press enter, this will open up the Python interpreter. Then type the code and press enter, the output will be shown in the next line.
This is a basic example, but it demonstrates the basic structure of a Python program. The print() function is a built-in function in Python that outputs whatever text is passed to it as an argument to the console.
You can also create variables, use loops, conditions, functions, classes, and many other features of python to make your program more sophisticated and powerful.
Comments
Post a Comment