Have you ever thought of starting Python?
Then you are in the right place to be. Today, I will get your hands ready and set to go for coding in Python. So without further ado, let us get our hands dirty with an overview of what we need to do and what a programming language actually is.
Basically, a Computer programming language is a set of instructions given to a computer to perform a specific task. The computer follows these sets of instructions in sequential order and thus it is necessary to keep an eye out for any such related mistakes. There are two main types of programming languages:
- Compiled Languages
- Interpreted Languages
Once the code is compiled in Compiled languages, it is given out as per the target machine’s instruction. For instance, in C++ if you type ‘-‘ the computer will automatically translate that into the ‘Subtract’ instruction and then it will be executed.
On the other hand, in the case of interpreted languages, the instructions are not directly executed by the machine and instead are done by another programming language (which is usually the native language of the machine).
Firstly, keep in mind that Python is an interpreted language so we need an interpreter for it to function and work. For that what we need to do go over to Python’s official website and do the following:
- Head over to the downloads tab in the website’s top-most menu
- And then click on the button that says ‘Python 3.9.5’ (this is the current latest version of Python’s interpreter) and your download will start shortly.
- After downloaded, open the installer and keep the following settings
So here is the set-up of the Python interpreter, but we need an IDE or ‘Integrated Development Environment‘ that will enable us to program in Python. Currently, the most preferred IDE in the market is PyCharm By JetBrains. So let us get ready to go.
- Go over to PyCharm’s download page and download the Community (free) version
- When you first install the latest version of PyCharm (2021.1) you’ll get a window like this one. Click on the new project button to get started with your first lines of code.
- After clicking on the New project button, you’ll get a window like this one. At the end of your location, type your project’s desired name; it is ‘Test’ for me. For the interpreter, choose ‘New Environment using Virutalenv‘ and then choose the base interpreter as per the version of Python you installed. Finally, hit the create button and get ready for coding in Python.
- Delete all the sample code in the default main.py file
Now that you are done with the set-up, it’s time that we write a few lines of code…
For today, we are going to learn about the print() command. Basically, it is used to output any string (text in Python), integer (number in Python) and float (decimal in Python).
For instance, the following code will output this in the terminal:
So there you go guys. Another cool programming tutorial from IcodersLab. See you soon and until then, take care…