Board | CBSE – Central Board of Secondary Education |
Textbook | Code 417 |
Class | 10 |
Chapter | 4 |
Chapter Name | Advance Python |
Subject | Artificial Intelligence 417 |
Table of Contents
hideCore Concepts of Python Programming
Now we are going to start the most awaited chapter in AI that is Python Programming. But this is also the most misunderstood chapter by all the students because when you are starting programming it is not only about coding. before that Core Concepts are Necessary.
If you are want to jump directly into Python Programming without learning the core concepts then Jump to Python Content
What is Programming ?
So before learning what is programming, I want to ask you one simple question, why do you use a computer or a phone, in my case I use it for google search, Meetings, a calculator, and many more things.
So have you ever thought that how that device understands, what you want the device to do when you click the calculator app button? This is done via programming.
A Program is a set of instructions that tells the computers what to do in order to come up with a solution for a particular problem.
When you instruct a computer to perform specific tasks then this is called Computer Programming.
Programming Languages
We learned that we need to Instruct a computer to perform certain tasks and this is called Programming, But How to Program a machine? How do we instruct computers?
Well, How does your teacher instruct you, Simply she uses a language as a medium because you and the teacher both know the language like English. But what if one of you doesn’t understand that language, in that case, you need to use another language which you both know.
This is where the Concept of Programming languages comes, programming language is a formal language designed to communicate instructions to a computer.
Binary or Machine Code
We know that Computers do not understand the language which we speak, like English. Computers understand Only understand Machine language, also known as Binary Language, technically speaking this is the only language which computers understand… for example “01001000 01100101 01101100 01101100 01101111 00100001”
Those ones and zeros might not look like anything to you, but in binary code, these numbers are actually saying “Hello!”.
Why machines can understand only Binary Language?
Why can’t computers understand English why only those 0s and 1s and the answers are these 0s and 1s contribute to a concept called truth table, and 0 is represented as false and anything non zero represents true as there are only 2 numbers 0s and 1s in binary language so 0 represents false and 1 represents true, well in short, to understand why computers understand only machine code we need to see how a processor works.
Here’s how a processor works, the processor already contains the circuit to control all of these instructions, but the correct circuitry gets connected together when, the instruction is provided for that, for example, certain transistors will open or close with 1s or 0s, because as we discussed 0 means false and 1 means true.
If everything was a bouncer for you then it’s totally fine you will be able to understand these concepts clearly in the future,
so here is the representation of mostly used letters and symbols in machine code or binary code.
CONCLUSION:-
So as we discussed, machines can’t understand English or any other language, they only know machine language that is in 0s and 1s and we cant use it as a medium between us and computers, as u saw we need to write a lot for a few words to be printed, like hello. So it isn’t efficient for us to do that.
Assembly Language
The Problem: We need to program the machine but it’s not easy to learn the Binary Code or Machine language
The Solution: Due to this Assembly language was Introduced as a first step to improve programming structure and make machine language more understandable by humans.
Features of Assembly Language
hide- First step to improve programming structure and make machine language more understandable by humans.
- This is the second generation of computer language
- Replacing the 0s and 1s this language used a set of symbols and letters.
- Uses Assembler for converting Assembly lanuguage code to machine level code.
- Example: To add or subtract it uses to add or sub respectively
But wait we discussed that computer can only understand machine language so how it is going to understand Assembly Language because it’s not in 0s and 1s, well it is simple, for example when presidents of 2 countries want to talk to each other considering the fact that they don’t understand each other’s language then you know how do they communicate? if you said translators, then you are absolutely correct, they have translators who understand both languages and can convert one language to another.
Similarly, Assembly language can be translated or rather converted into Machine level language using Assemblers. So assemblers act as a translator between assembly language and machine-level language.
High Level Language
Problems with Assembly Language: Assembly language was not as hard as Machine Level Language but it was still hard for many of us, to understand the difference we can see the same Hello world code in assembly language also.
So We need to find another language that is more human-understandable and simple to code.
Here comes the programming languages like Python, Java, C, C++. and these languages are called High-Level Languages.
Which are way simpler to understand, to just compare Machine level language, assembly language, and High-level languages we can see the same hello world program in python also.
You can see how simple is it to write in high-level languages.
All the languages discussed here needs a converter called Compiler, there are different type of compilers such as Assemblers and Interpreters. Python is compiled using an interpreter. To know more about Compilers, Interprets, and Assemblers you may read the article below.
Okay, now we understood that we need to program a computer to instruct it, to do tasks with the help of programming languages which are compiled to machine level code or byte code.
So there are 2 ways to write a program.
Procedure Oriented and Object-oriented or we can call it OOPS (Object-oriented Programming System)
Introduction to Python
Now let’s get started with Python programming, we have already studied basic concepts of Python in Class 9, If you do recall all the concepts then you are a champ, but if you want to recall the concepts with me, let’s do it right now.
What is Python ?
Python is a High-Level Multipurpose Interpreted Programming language that is becoming popular day by day.
Why to use Python ?
Why is Python so popular?
hide- Easy to Learn, Read and Maintain – Highly Productive
- Supports both Object and Procedure Oriented Programming
- 100ds of Libraries and Frameworks
- Flexibility of Python Language
- Big data, Machine Learning and Cloud Computing
- Versatility, Efficiency, Reliability, and Speed
- Databases and Scalable
Details of Python
Python – Programming Language | |
Abbreviation | Py |
File Extensions | .py, .pyi, .pyc, .pyd, .pyo |
Designed by | Guido van Rossum |
Released On | 20 February 1991 (30 years ago) |
Developers | Python Software Foundation |
Type | Programming Language (Both Object-Oriented and Procedure Oriented) |
Official Website | https://www.python.org/ |
Name Inspiration | “BBC comedy series from the 1970s – “Monty Python’s Flying Circus” |
Applications of Python
Application | Examples |
Web and Internet Development | Django, Flask, Bottle, Pyramid Framework, Plone |
Desktop GUI Applications | Tkinter or Tk, Kivy (used for writing multitouch applications ), PyQt or Pyside |
Software Development | SCons, Buildbot, Roundup, Trac, Apache Gump |
Games and 3D Graphics | Fandango (Popular ), CAMVOX, HeeksCNC, AnyCAD, RCAM |
Database Access | Psycopg2, Pymongo |
Business Applications | Oddo, Tryton |
Image Processing Application | OpenCV, Pillow, SimpleITK |
Machine Learning | SciPy, Scikit-learn, NumPy, Pandas, Matplotlib Etc |
Python Syllabus for Class 10
The Reduced Syllabus of Python Class 10 for Term 2 Board Exams CBSE is available in the Article Given Below.
S.NO | ADVANCE PYTHON CONTENT | Page Link |
1. | Jupyter Notebook | Not Included |
2. | Virtual Environments | Not Included |
3. | Python and Its Applications | Open the Page |
4. | Python Statements and Comments | Open the Page |
5. | Keywords And Identifiers | Not Included |
6. | Variables in Python | Open the Page |
7. | Python Datatypes | Open the Page |
8. | Python Inputs | Not Included |
9. | Python Operators | Not Included |
10. | Python Conditional Statements | Not Included |
11. | Loops In Python | Not Included |
12. | Python Packages | Not Included |