Python is a popular, general-purpose programming language and has straight forward syntax. Python also provides many built-in functions. In this tutorial, we will learn how to start with Python programming.
This is the most basic Python program. It specifies how to print any statement in Python.
In old Python (up to Python 2.7.0), the print command is not written in parenthesis, but in new python software (Python 3.4.3), it is mandatory to add parenthesis to print a statement.
Let' see the following example to print Hello World
print ('Hello World')
Hello World
In the above code, we have used the built-in print() method to print the string 'Hello World' on the terminal. Python takes only one line to print the 'hello world' program.
First read the algorithm, then study the program code line by line. After that, compare the code with the output and finally go through the explanation. This approach helps learners understand both the logic and the implementation properly.
After understanding this example, try to rewrite the same program without looking at the code. Then change some values or logic and run it again. This helps improve confidence and keeps learners engaged on the page for longer.