Create and Run the Hello World Program in Python
A school fair needs a welcome screen at the entrance. Print a greeting first. Seeing the exact words on screen confirms that the saved program ran and sent text to its output.
1. Save the following program as HelloWorld.py.
class HelloWorld:
def __init__(self):
pass
def printMessage(self):
print("Hello World")
obj = HelloWorld()
obj.printMessage()
2. On Windows run py HelloWorld.py. Where Python 3 is installed as python3, run python3 HelloWorld.py.
