Saturday 16 September 2017

Python Hello World Program

Various ways to start Python:

  • Immediate mode

Typing python, command line will invoke the interpreter in immediate mode

  • Script mode

This mode is used to execute Python program written in a file. Such a file is called a script. Scripts can be saved to disk for future use. 
Note: Python scripts have the extension .py, meaning that the filename ends with .py.

Example: helloWorld.py

To execute this file in script mode we simply write python helloWorld.py at the command prompt.

Or can use IDE of python , Ex: PyCharm

Hello World Program in Python:

Immediate mode:

>>> print("Hello World")

Hello World

Using PyCharm IDE:




Previous_page                                                                                                                          Next page

2 comments:

  1. Excellent post. You have shared some wonderful tips. I completely agree with you that it is important for any blogger to help their visitors. Once your visitors find value in your content, they will come back for more How to Run Python Program In Script Mode



    ReplyDelete

Fundamentals of Python programming

Fundamentals of Python programming: Following below are the fundamental constructs of Python programming: Python Data types Python...