Why learn Python from Subrat Sir?
- I highly value your time so tried to put maximum value in the optimal time.
- I am going to explain each and every concept by writing code
- I have tried to keep concept as simple as possible so you can understand it easily
- You can master all the basics of python programming
Basic Terminologies in Python
What is a Language ?
It is a medium of communication
What is a Program ?
A set of instructions (may be input , output , math , conditional execution) that specifies how to perform a specific task.
What is a programming language ?
A Programming language is used to write set of instructions so that computer can understand and perform operations as required.
What is the difference between Low level programming language and High Level Programming language ?
Low level programming languages are machine understandable codes. Where as High level programming languages are programmer understandable codes. Machine can not understand these codes so we need a compiler or interpreter to convert these codes to machine understandable format.
What is the difference between compiler and interpreter ?
Compiler translates all the statements written in program at once and displays errors if any otherwise generates machine understandable code file. While interpreter converts one statement at a time into machine code. If any error found, conversion as well as program execution halts there. Compiled codes runs faster then interpreted codes.
Python is a High level programming language. Python programs uses interpreters at the run time.
Why is Python named so ?
Well not so important. But in case you are curious about its name origin then here is the answer. Guido Van Rossum (Python Inventor) was reading the published script from “Monty python’s Flying Circus”, a BBC comedy series from the 1970s, When working on the development of Python. Van Rossum may needed a name that was short, unique and slightly mysterious, so he might decided to call the language Python.
Write first program in Python
How to Practice Python ?
If you have a desktop or laptop, you can either install python or practice it online using any online interpreter.
If you are using a smartphone and have no access to laptop or desktop then you can download any python IDE available for smartphone or you can also practice using online interpreter.
As a beginner user, online interpreter is the best option for you, if you have internet access. Personally, I do not like shortcuts but when ever a shortcut is available it is not advisable to take long root.
Why use IDE to write program?
If you are installing Python or any other programming language, For a beginner programmer it is suggestible to use IDE (integrated Development Environment), because IDE is a full fledged environment. It provides all the essential tools, a programmer needed for a software development. It handles the code(for example, write, edit syntax highlighting and auto-completion) as well as provides other features such as debugging, execution, testing and code formatting that makes easier for a programmer to write a program.
Let us write our first python program.
Errors in Python
What is a Bug ?
A Programming Error.
What is Syntax Error ?
It is similar to grammatical error in real life languages.
What is a Runtime Error ?
It is also called exceptions and occurs during program execution. It will not appear until a program starts running.
What is a Semantic Error ?
The program runs perfectly without any error. But does not give the desires result.
Values and variables in Python
What is a Value ?
The basic thing a program works with. The type of a value or variable can be checked using type() function.
What is a variable ?
A named memory location to store values. = operator is used to store value to variable. Variables are case sensitive so a and A has different meaning to Python.
- Python build-in keywords can not be used as a variable name
- Variable names can contain letters, numbers and underscores
- Variable names can not start with a number
Functions and Methods in Python
What is a Function ?
A function is a block of code which only runs when it is called. We can pass data into it and get return from it. A function provides a better modularity of our application and a high degree of code reusing. There are some build-in functions and we can also write a function called as user defined function.
What is a method ?
A method is a function in object-oriented programming and can be run using the dot operator.
To get certificate of any course please use PGDCA app from play store. Prepare yourself from your home or live classes. Appear the exam and get certified.