BoardCBSE – Central Board of Secondary Education
TextbookCode 417
Class10
Chapter4
Chapter NameAdvance Python
SubjectArtificial Intelligence 417

Core 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

Types of Programming lanugages

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!”.

Programming Languages - Binary and Machine Code

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
  1. First step to improve programming structure and make machine language more understandable by humans.
  2. This is the second generation of computer language
  3. Replacing the 0s and 1s this language used a set of symbols and letters.
  4. Uses Assembler for converting Assembly lanuguage code to machine level code.
  5. 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.

Hello world in Binary, assembly and High Level Language

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.


Related ArticleCompilers, Interpreters and Assemblers

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), you may refer to the Article Below to learn about Procedure and Object-Oriented Programming Systems.

Related ArticleProcedure and Object-Oriented Programming

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 ?

Details of Python

Python-logo-notext.svg
Python – Programming Language
AbbreviationPy
File Extensions.py, .pyi, .pyc, .pyd, .pyo
Designed byGuido van Rossum
Released On20 February 1991 (30 years ago)
DevelopersPython Software Foundation
TypeProgramming Language (Both Object-Oriented and Procedure Oriented)
Official Websitehttps://www.python.org/
Name Inspiration“BBC comedy series from the 1970s – “Monty Python’s Flying Circus”

Applications of Python

ApplicationExamples
Web and Internet DevelopmentDjango, Flask, Bottle, Pyramid Framework, Plone
Desktop GUI ApplicationsTkinter or Tk, Kivy (used for writing multitouch applications ), PyQt or Pyside
Software DevelopmentSCons, Buildbot, Roundup, Trac, Apache Gump
Games and 3D GraphicsFandango (Popular ), CAMVOX, HeeksCNC, AnyCAD, RCAM
Database AccessPsycopg2, Pymongo
Business ApplicationsOddo, Tryton
Image Processing ApplicationOpenCV, Pillow, SimpleITK
Machine LearningSciPy, 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.


Related ArticlePython Syllabus for Term 2 Class 10

S.NO
ADVANCE PYTHON CONTENT

Page Link
1.Jupyter Notebook Not Included
2.Virtual EnvironmentsNot Included
3.Python and Its ApplicationsOpen the Page
4.Python Statements and CommentsOpen the Page
5.Keywords And Identifiers Not Included
6.Variables in PythonOpen the Page
7.Python DatatypesOpen 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