What is Python?
Python is a high-level object-oriented programming language. It was developed by Guido Van Rossum in 1991. Python is a very easy-to-use, interpreted, expressive language. It is one of the most popular programming languages and has many different use cases.
Python is an interpreted language, which means that it executes code line by line and if there is any error, the program execution stops at that line. It can only continue after the error has been corrected.
Why you should learn Python.
- Python is very easy to use and due to its very simple syntax, it is very beginners friendly.
- Python is a cross-platform, open-source language, it is free to use python and you can use it on almost any operating system.
- Python is being used in many different fields like machine learning, data science, web development, scripting, game development, GUI programs, etc.
- Python is an interpreted language, so it makes it easy to debug compared to compiled languages.
Using Python on Your System
- The first thing you need to do is download and install python on your system, You can download python from its official website. python.org
- Next, you need to use some kind of code editor like vscode and set it up for python, here is the official guide or you can use PyCharm ide download it from here
- If you don't want to install it on your system, you can also use an online code editor like Replit
Writing Your First Python Program
Whenever we learn any new programming language, the first thing we do is that we write a hello world program that displays a โHello Worldโ message, and in this section of the article we are going to do the same.
In Python when we have to display any message or output on the screen we use print
function.
print("Hello World")
when we use print function anything inside the parenthesis is displayed on the screen. Here are the few more examples.
print("Hello There")
print('My name is Ankit')
print(23)
print(45 + 34)
Comments in Python.
In the world of programming, comments are the lines of code that are not executed by the interpreter or compiler, these lines are simply ignored by the interpreter or compiler. Every programming language has a different syntax to write comments, but in python, we use the #
symbol to write comments.
For writing comments in python, you just need to add the #
symbol at the start of the line, and the python interpreter will just ignore that line during program execution.
# This line is commented
# print("Hello There")
Conclusion
That's it for this article, I hope you enjoyed it, in the next article we are going to talk about Variables, keywords, character sets, values, etc.