How to learn Python?
Python is a high-level programming language that has a focus on readability. The syntax of Python is quite easy to follow in comparison to other programming languages. The primary benefit of python is that it is a ‘high-level’ language that can execute complex tasks in relatively few lines of code. Not only is Python one of the easiest languages to learn, it is also used worldwide for a wide variety of applications. Hence it has become known as the ‘swiss army knife’ of programming languages.
A basic understanding of how a python script compiles and runs code is important in order to begin practice. The best way to do this is by writing a basic python script (a file usually ending in .py) and attempting to run the script through the command line on your computer. A standard installation of Python will come with what is called the Python Interactive Shell, which allows users to execute simple python commands from within the terminal. This is a great tool that can be used to see how basic tasks can be achieved through very simple syntax. For example:
>>> num1 = 10
>>> num2 = 9
>>> num3 = num1 + num2
-> Will produce 19
>>> “happy” + ” ” + “birthday”
-> Will produce ‘happy birthday’
Similar to learning any other programming language, practice every day is important. Undertaking simple projects will go a long way in terms of exposing the user to Python’s expansive libraries and feature list. There are many different approaches to learning the language itself, either through building simple scripts of your own, or practice through online web tutorials on sites like codingdojo.com or khanacademy.com.