Skip to main content

Command Palette

Search for a command to run...

Python programming for newbies : How to learn python

Published
3 min readView as Markdown
Python programming for newbies : How to learn python

Introduction

Python, created by Guido van Rossum in 1991 and supported by the Python Software Foundation, is a popular high-level programming language that finds extensive use in various domains. Its primary focus is on making code easily readable, and its syntax enables programmers to convey ideas using concise code structures.

Python is used for?

Python is frequently employed in website and software development, automating tasks, analyzing data, and visualizing information. Due to its user-friendly nature, Python has gained popularity among individuals who are not primarily programmers, such as accountants and scientists. These non-programmers utilize Python for various day-to-day activities, including managing finances and other organizational tasks.

Why choose Python as a newbie?

  • Python is compatible with various operating systems such as Windows, Mac, Linux, Raspberry Pi, and more.

  • Python employs a straightforward syntax reminiscent of the English language.

  • Python's syntax enables developers to write programs with fewer lines compared to certain other programming languages.

  • Python operates on an interpreter system, enabling immediate execution of code as soon as it is written. Consequently, prototyping can be done swiftly.

  • Python can be approached from different programming paradigms, including procedural, object-oriented, and functional styles.

Installation on the command line

In many PCs, python is normally pre-installed. To check if Python is installed on your Windows PC, run the following command in your command line.

C:\Users\Your Name>python –version

For a Mac and Linux system, use the following command in your terminal.

python –version

In case you find that you lack Python on your pc, do not panic. You can click the link and download the latest version of Python. Anything above Python 3.9 is recommended.

How to use Python in the command line?

In Python, the language operates in a unique way where developers compose their code in plain text files with a special format known as ".py". These files are then handed over to a designated entity called the Python interpreter, which takes charge of executing the code. Essentially, it's like preparing a script using a text editor and entrusting it to a proficient performer, the interpreter, who brings it to life on stage.

Here is an example of how to run a Python file in your command line.

C:\Users\Your Name>python myFirstPythonFile.py

or

C:\Users\Your Name>py myFirstPythonFile.py

Let's write our first Python file, called myFirstPythonFile.py, which can be done in any text editor.

print("Hello, World!")

The output will be Hello, World!

Congratulations on writing your first line of code in Python. As you progress to learn more about the syntax, you shall be able to build simple projects such as a calculator, a sea level predictor, medical data visualizer and many more. One of the best platforms to learn Python from scratch is :

  1. w3schools/python

  2. freeCodeCamp

Conclusion

In conclusion, the Python programming language serves as an excellent introduction for newcomers to the world of coding. With its compatibility across various platforms, including Windows, Mac, Linux, Raspberry Pi, and more, Python offers a versatile foundation for aspiring developers. Its simplicity and English-like syntax make it remarkably approachable, enabling beginners to grasp the fundamental concepts of programming with ease.

For newcomers venturing into the world of programming, Python emerges as a gentle yet powerful language, fostering a smooth transition into the realm of coding. With its broad range of applications, extensive community support, and user-friendly nature, Python serves as an invaluable tool for novices embarking on their coding journey.

Happy Coding!