Hello World In Python is the tutorial for Python beginners.
Before start code using Python, Things you should need to know that Python is the easiest programming language in the world !! actually the python is scripting language, so we can have fun with writing our small scripts in Python. From the Line Of Code (LOC) purpose, Python code is much smaller than C/C++ and Java, as the Hello World In Python can be implemented only with a single line code.
Python is basically available in two versions, Python 2 and Python 3 (e.g Python 2.7 and Python 3.3). Python 2.7 is widely used version of Python , I also recommend Python 2.7 because of compatible to old codes. Also the scripts on this website write using Python 2.7 .There is no such difference in python 2 or 3 , the small changes to string encoding etc is used in Python 3.
Follow these steps for start programming using Python on Windows:
- Download latest version of Python 2.7 or Python 3(i recommend Python 2.7 ) from here , choose installer as per your operating system 32-bit or 64-bit.
- Install Python by double-click on the downloaded file.
- Open Python IDLE , click Start > all Programs > Python (IDLE GUI ), for Windows 8: Type python on Start window, click on IDLE(Python GUI)
The following screen will appear, its Python IDLE.
- Now you can directly write your code here
print “Hello World”
- or write as script by following steps
- For write python code in file and save for further use we’ll write a python script.
click on File > New Window ,write your code here
print “Hello World”
for save press Crtl+S write filename, hello.py and run by pres F5 key.
- it will print message hello world on screen.
hello world explained:
print – is a method for print message on screen.
“Hello world” – is a string
Hence code for hello world is :-
print "hello world"
Congratulation !! you’ll learn how to use python, follow the other tutorials for learn the python in easy way or you can refer a free eBook on python ‘Byte of Python’ form here or refer the official website for further learning documents http://www.python.org/