Python is a very powerful, general-purpose programming language created by Guido Van Rossum.
Python is known for its easy to use and learn syntax hence perfect for someone who is trying to learn Python for the first time.
This comprehensive guide covers all the basics of Python as well as advanced topics in Python.
- Python is general purpose language. We can use python for web development, game development, scientific computing. Also, Python is the most preferred language for data science and machine learning.
- Python is very easy to learn and easy to understand.
- Python is open source.
- The Large number of standard library to solve common problems.
- Python is a interpreted language. Also, we can write our Python code in interactive mode.
- You can integrate your code with language i.e. C, Java to Python.
Installing Python in your system
For Windows Users
Go to Python Official Website. Move your mouse on download tap. This will pop up a window. Download python3 from here. Open the .exe file and follow the instructions. Don't forget to tick on add python3.6 to path.
For Linux Users
Python is preinstalled in Linux and Mac. If you wish to install newer versions of Python3 follow this link
Start Writing Your Code
There are two ways to write code in Python
1. You can write your code in Python Interactive Mode. Open Command Prompt(Windows User) or Terminal(Linux or Mac users) and type python and enter. It will open Python interactive mode. Here you can write code temporarily. You can check all the functionality of Python. However, If you want to save your code in system it is better to write code in script (see point 2)
2. You can Write your code in a Python Script. Open any text editor like notepad, notepad++(windows) or gedit(Linux) and create a new file and save it with .py extension(i.e. filename.py).
NOTE - It is advisable to use IDE(Integrated Development Environment) i.e Sublime Text, pycharm.
Writing Python Code in Sublime Text
After installing Sublime Text in your system, open it and write your Python code. Save your file with .py extension (i.e. filename.py). Go to Tools menu and go to build system and select Python. Now write your Python Code and run your python script with ctrl + B.
Let's Start Learning Python:
- Introduction to Python
- Control Flow
- Python Functions
- Python Native Datatypes
- Python Files Handelling
- Object Oriented Programming
- Python Exceptions
Credits and References
- Book 'How to think like a Computer Scientist Learning with Python' by Allen Downey, Jeffrey Elkner and Chris Meyers