8 python hello world
Printing a “Hello World” sentence to screen is the traditional first program in many languages. For python this is very easy one line code.
- Open a new file in a Programmers Text Editor and write following line
print("hello world!")
save the file as helloworld.py and exit editor.
Open a command line/Terminal
Go to folder you have saved your file
Write
python helloworld.py
8.1 Python interpreter
Python is different from some languages such as C and java that it is not a compiled language but an interpreted language.
python code --> python interpreter --> output
8.2 comments
If we want to some of the writing to be not interpreted (executed) by python, we should use comments. Comments are ignored by python interpreter. See below example for comments.
download above example comments code