Just like we use Hindi or English to communicate with each other, we use a Programming language to communicate with the computer.
Programming is a way to instruct the computer to perform various tasks.
Python is a simple and easy-to-understand language that feels like reading simple English. This Pseudo code nature of Python makes it easy to learn and understandable for beginners.
Installation
Python can be easily installed from python.org
When you click on the download button, python can be installed right after you complete the setup by executing the file for your platform.
Tip: Just install it like a game ☻
Let’s write our very first python program.
Create a file called hello.py and paste the below code into it
Execute this file (.py file) by typing python hello.py, and you will see Hello World printed on the screen.
A module is a file containing code written by somebody else (usually) which can be imported and used in our programs.
Pip is a package manager for python. You can use pip to install a module on your system.
E.g., pip install flask (It will install flask module in your system)
There are two types of modules in Python:
Some examples of built-in modules are os, abc, etc.
Some examples of external modules are TensorFlow, flask, etc.
Using Python as a Calculator
We can use python as a calculator by typing “python” + TO DO on the terminal. [It opens REPL or read evaluation print loop]
Comments are used to write something which the programmer does not want to execute.
Comments can be used to mark the author's name, date, etc.
Types of Comments:
There are two types of comments in python,
A variable is a name given to a memory location in a program. For example
Variable – Container to store a value
Keywords – Reserved words in Python
Identifiers – class/function/variable name
Primarily there are the following data types in Python:
Python is a fantastic language that automatically identifies the type of data for us.