SlideShare a Scribd company logo
1 of 50
Download to read offline
Jupyter Notebook
Python GUI
• It is an incredibly powerful tool for
interactively developing and presenting AI
related projects.
• The Jupyter project is the successor to the
earlier IPython Notebook, which was first
published as a prototype in 2010.
• Different programming languages can be used
• Different programming languages can be used
within Jupyter Notebooks, Python remains the
most commonly used language for it.
• Jupyter Notebook is an open source web
application that can be used to create and
share documents that contain live code,
equations, visualizations, and text.
It works on…
• LOCALHOST 127.0.0.1
• Port Number 8888
• The easiest way to install and start using
Jupyter Notebook is through Anaconda.
• Anaconda is the most widely used Python
distribution for data science and comes pre-
loaded with all the most popular libraries and
tools.
• With Anaconda, comes the Anaconda
• With Anaconda, comes the Anaconda
Navigator through which we can scroll around
all the applications which come along with it.
• Jupyter notebook can easily be accessed using
the Anaconda Prompt with the help of a local
host.
• To work with Jupyter Notebook, it is necessary
to have a kernel on which it operates.
• A kernel provides programming language
support in Jupyter.
• IPython is the default kernel for Jupyter
Notebook.
• Therefore, whenever we need to work with
Jupyter Notebook in a virtual environment, we
first need to install a kernel inside the
environment in which the Jupyter notebook
will run.
Introduction to Virtual Environments
• A virtual environment is a tool that helps to
keep dependencies required by different
projects separated, by creating isolated
Python virtual environments for them.
Python virtual environments for them.
• This is one of the most important tools that
most of the Python developers use.
Why it is required?
• Imagine a scenario where we are working on two
Python-based projects and one of them works on
Python 2.7 and the other uses Python 3.7.
• In such situations virtual environment can be
really useful to maintain dependencies of both
the projects as the virtual environments will
make sure that these dependencies are not
the projects as the virtual environments will
make sure that these dependencies are not
conflicting with each other and no impact
reaches the base environment at any point in
time.
• Thus, different projects developed in the system
might have another environment to keep their
dependencies isolated from each other.
Introduction to Python
• Python is a programming language which was
created by Guido Van Rossum and publicly
released in 1991.
• It got its name from a BBC comedy series from
1970s – ‘Monty Python’s Flying Circus’.
• It can be used to follow both procedural
approach and object-oriented approach of
programming.
• Python has a lot of functionalities which
makes it so popular to use.
• Artificial intelligence is the trending
technology of the future.
• We can see so many applications around us.
• If we as individuals would also like to develop
an AI application, we will need to know a
programming language.
programming language.
• There are various programming languages like
Lisp, Prolog, C++, Java and Python, which can
be used for developing applications of AI.
Python gains a maximum popularity
because of the following reasons:
• Easy to learn, read and maintain
• Python has few keywords, simple structure
and a clearly defined syntax.
• Python allows anyone to learn the language
• Python allows anyone to learn the language
quickly.
• A program written in Python is fairly easy-to-
maintain.
• A Broad Standard library
• Python has a huge bunch of libraries with
plenty of built-in functions to solve a variety of
problems.
problems.
• Interactive Mode
• Python has support for an interactive mode
which allows interactive testing and
debugging of snippets of code.
debugging of snippets of code.
• Portability and Compatibility
• Python can run on a wide variety of operating
systems and hardware platforms, and has the
same interface on all platforms.
same interface on all platforms.
• Extendable
• We can add low-level modules to the Python
interpreter.
• These modules enable programmers to add to
• These modules enable programmers to add to
or customize their tools to be more efficient.
Applications of Python
• Software Development
• Games and 3D Graphics
• Database Access
• Business Applications
• Business Applications
• Web and Internet Development
• Desktop GUI Applications
Python Basics
• Printing Statements
• We can use Python to display outputs for any
code we write.
code we write.
• To print any statement, we use print()
function in Python.
• Python Statements and Comments
• Instructions written in the source code to
execute are known as statements.
• These are the lines of code which we write for
the computer to work upon.
• For example, if we wish to print the addition
of two numbers, say 5 and 10, we would
of two numbers, say 5 and 10, we would
simply write: print(5+10)
• This is a Python statement as the computer
would go through it and do the needful (which
in this case would be to calculate 5+10 and
print it on the output screen)
• On the other hand, there exist some statements
which do not get executed by the computer.
• These lines of code are skipped by the machine.
• They are known as comments.
• Comments are the statements which are
incorporated in the code to give a better
understanding of code statements to the user.
• To write a comment in Python, one can use # and
• To write a comment in Python, one can use # and
then write anything after it.
• For example:
• # This is a comment and will not be read by the
machine.
• print(5+10) # This is a statement and the
machine will print the summation.
• Keywords & Identifiers
• In Python, there exist some words which are
pre-defined and carry a specific meaning for
the machine by default.
• These words are known as keywords.
Keywords cannot be changed at any point in
time and should not be used any other way
time and should not be used any other way
except the default one, otherwise they create
confusion and might result in ambiguous
outputs.
• An identifier is any word which is variable.
Identifiers can be declared by the user as per
their convenience of use and can vary
according to the way the user wants.
• These words are not defined and can be used
in any way.
• Keywords cannot be used as identifiers.
• Identifiers are also case-sensitive hence an
identifier named as Test would be different
from an identifier named test.
• Variables
• A variable is a named location used to store
data in the memory.
• It is helpful to think of variables as a container
that holds data which can be changed later
throughout programming.
throughout programming.
• Just like in Mathematics, in Python too we can
use variables to store values in it.
• The difference here is, that in Python, the
variables not only store numerical values, but
can also contain different types of data.
• For example:
• X = 10
# X variable contains numerical data
• Letters = ‘XYZ’
# Letters variable contains alphabetic data
• number = 13.95
• number = 13.95
# number variable contains a decimal value
• word = ‘k’
# word variable contains a character
The rules for naming an identifier in
Python are as follows:
• The name should begin with
– an uppercase or a lowercase alphabet or
– an underscore sign (_).
This may be followed by any combination of
characters a-z, A-Z, 0-9 or underscore (_).
Thus, an identifier cannot start with a digit.
Thus, an identifier cannot start with a digit.
• It can be of any length.
(However, it is preferred to keep it short and meaningful).
• It should not be a keyword or reserved word .
• We cannot use special symbols like !, @, #, $, %,
etc. in identifiers .
TOKENS IN PYTHON
• Smallest individual unit in a program is
known as token.
• Keywords
• Identifiers
• Identifiers
• Literals
• Operators
• Punctuators
Data Types
Data types Specifies which type of value a variable
can store.
Data Types
Numbers (int, Float)
Boolean
Boolean
Tuple
List
String
Set
Dictionary
• Python inputs
• To collect the data from the user at the time
of execution, input() function is used.
• While using the input function, the datatype
of the expected input is required to be
mentioned so that the machine does not
mentioned so that the machine does not
interpret the received data in an incorrect
manner
• As the data taken as input from the user is
considered to be a string (sequence of
characters) by default.
• Python Operators
• Operators are special symbols which represent
computation.
• They are applied on operand(s), which can be
values or variables.
• Same operators can behave differently on
different data types.
different data types.
• Operators when applied on operands form an
expression.
• Operators are categorized as Arithmetic,
Relational, Logical and Assignment.
• Value and variables when used with operators are
known as operands.
Expressions
• An expression is defined as a combination of
constants, variables and operators.
• An expression always evaluates to a value.
• A value or a standalone variable is also
considered as an expression but a standalone
considered as an expression but a standalone
operator is not an expression.
• Some examples of valid expressions are given
below.
• (i) num – 20.4 (iii) 23/3 -5 * 7*(14 -2)
• (ii) 3.0 + 3.14 (iv) "Global"+"Citizen"
Give the output of the following when
num1 = 5, num2 = 4, num3 = 1
a) num1 += num2 + num3
b) num1 = num1 ** (num2 + num3)
c) num1 **= num2 + c
d) num1 = '5' + '5'
d) num1 = '5' + '5'
e) print(4.00/(2.0+2.0))
f) num1 = 2+9*((3*12)-8)/10
g) num1 = float(10)
h) num1 = int('3.14')
• print('Bye' == 'BYE')
• print(10 != 9 and 20 >= 20)
• print(10 + 6 * 2 ** 2 != 9//4 -3 and 29>= 29/9)
• print(5 % 10 + 10 < 50 and 29 <= 29)
• print((0 < 6) or (not(10 == 6) and (10<0)))
Class_X_PYTHON_J.pdf
Class_X_PYTHON_J.pdf
Class_X_PYTHON_J.pdf

More Related Content

Similar to Class_X_PYTHON_J.pdf

Python Programming.pdf
Python Programming.pdfPython Programming.pdf
Python Programming.pdfssuser9a6ca1
 
Python programming ppt.pptx
Python programming ppt.pptxPython programming ppt.pptx
Python programming ppt.pptxnagendrasai12
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python ProgrammingAkhil Kaushik
 
Lecture1_introduction to python.pptx
Lecture1_introduction to python.pptxLecture1_introduction to python.pptx
Lecture1_introduction to python.pptxMohammedAlYemeni1
 
python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptxArpittripathi45
 
Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptxPython_Introduction&DataType.pptx
Python_Introduction&DataType.pptxHaythamBarakeh1
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxlemonchoos
 
Python Programming
Python ProgrammingPython Programming
Python ProgrammingRenieMathews
 
Python for students step by step guidance
Python for students step by step guidancePython for students step by step guidance
Python for students step by step guidanceMantoshKumar79
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unitmichaelaaron25322
 
Python-Yesterday Today Tomorrow(What's new?)
Python-Yesterday Today Tomorrow(What's new?)Python-Yesterday Today Tomorrow(What's new?)
Python-Yesterday Today Tomorrow(What's new?)Mohan Arumugam
 
Introduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptxIntroduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptxHassanShah396906
 
Chapter-introduction about java programming
Chapter-introduction about java programmingChapter-introduction about java programming
Chapter-introduction about java programmingDrRajeshkumarPPatel
 
An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()Blue Elephant Consulting
 

Similar to Class_X_PYTHON_J.pdf (20)

Python Programming.pdf
Python Programming.pdfPython Programming.pdf
Python Programming.pdf
 
Python programming ppt.pptx
Python programming ppt.pptxPython programming ppt.pptx
Python programming ppt.pptx
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
 
Python intro
Python introPython intro
Python intro
 
PYTHON UNIT 1
PYTHON UNIT 1PYTHON UNIT 1
PYTHON UNIT 1
 
Lecture1_introduction to python.pptx
Lecture1_introduction to python.pptxLecture1_introduction to python.pptx
Lecture1_introduction to python.pptx
 
python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptx
 
Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptxPython_Introduction&DataType.pptx
Python_Introduction&DataType.pptx
 
intro to python.pptx
intro to python.pptxintro to python.pptx
intro to python.pptx
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptx
 
Python Programming
Python ProgrammingPython Programming
Python Programming
 
Python 01.pptx
Python 01.pptxPython 01.pptx
Python 01.pptx
 
1-ppt-python.ppt
1-ppt-python.ppt1-ppt-python.ppt
1-ppt-python.ppt
 
Python for students step by step guidance
Python for students step by step guidancePython for students step by step guidance
Python for students step by step guidance
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
Python-Yesterday Today Tomorrow(What's new?)
Python-Yesterday Today Tomorrow(What's new?)Python-Yesterday Today Tomorrow(What's new?)
Python-Yesterday Today Tomorrow(What's new?)
 
Introduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptxIntroduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptx
 
Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
 
Chapter-introduction about java programming
Chapter-introduction about java programmingChapter-introduction about java programming
Chapter-introduction about java programming
 
An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()
 

Recently uploaded

April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024
April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024
April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024Timothy Spann
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdfHuman37
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Cathrine Wilhelmsen
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024thyngster
 
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...Amil Baba Dawood bangali
 
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Boston Institute of Analytics
 
Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Seán Kennedy
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...Boston Institute of Analytics
 
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...ssuserf63bd7
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDRafezzaman
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一F sss
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Colleen Farrelly
 
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)jennyeacort
 
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...Thomas Poetter
 
Identifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanIdentifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanMYRABACSAFRA2
 
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxmodul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxaleedritatuxx
 
detection and classification of knee osteoarthritis.pptx
detection and classification of knee osteoarthritis.pptxdetection and classification of knee osteoarthritis.pptx
detection and classification of knee osteoarthritis.pptxAleenaJamil4
 
Vision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxVision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxellehsormae
 
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhijennyeacort
 

Recently uploaded (20)

April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024
April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024
April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
 
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
 
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
 
Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...
 
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
 
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024
 
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
 
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
 
Identifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanIdentifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population Mean
 
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxmodul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
 
detection and classification of knee osteoarthritis.pptx
detection and classification of knee osteoarthritis.pptxdetection and classification of knee osteoarthritis.pptx
detection and classification of knee osteoarthritis.pptx
 
Vision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxVision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptx
 
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
 

Class_X_PYTHON_J.pdf

  • 2.
  • 3. • It is an incredibly powerful tool for interactively developing and presenting AI related projects. • The Jupyter project is the successor to the earlier IPython Notebook, which was first published as a prototype in 2010. • Different programming languages can be used • Different programming languages can be used within Jupyter Notebooks, Python remains the most commonly used language for it. • Jupyter Notebook is an open source web application that can be used to create and share documents that contain live code, equations, visualizations, and text.
  • 4.
  • 5.
  • 6.
  • 7. It works on… • LOCALHOST 127.0.0.1 • Port Number 8888
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. • The easiest way to install and start using Jupyter Notebook is through Anaconda. • Anaconda is the most widely used Python distribution for data science and comes pre- loaded with all the most popular libraries and tools. • With Anaconda, comes the Anaconda • With Anaconda, comes the Anaconda Navigator through which we can scroll around all the applications which come along with it. • Jupyter notebook can easily be accessed using the Anaconda Prompt with the help of a local host.
  • 14.
  • 15. • To work with Jupyter Notebook, it is necessary to have a kernel on which it operates. • A kernel provides programming language support in Jupyter. • IPython is the default kernel for Jupyter Notebook. • Therefore, whenever we need to work with Jupyter Notebook in a virtual environment, we first need to install a kernel inside the environment in which the Jupyter notebook will run.
  • 16. Introduction to Virtual Environments • A virtual environment is a tool that helps to keep dependencies required by different projects separated, by creating isolated Python virtual environments for them. Python virtual environments for them. • This is one of the most important tools that most of the Python developers use.
  • 17. Why it is required? • Imagine a scenario where we are working on two Python-based projects and one of them works on Python 2.7 and the other uses Python 3.7. • In such situations virtual environment can be really useful to maintain dependencies of both the projects as the virtual environments will make sure that these dependencies are not the projects as the virtual environments will make sure that these dependencies are not conflicting with each other and no impact reaches the base environment at any point in time. • Thus, different projects developed in the system might have another environment to keep their dependencies isolated from each other.
  • 18. Introduction to Python • Python is a programming language which was created by Guido Van Rossum and publicly released in 1991. • It got its name from a BBC comedy series from 1970s – ‘Monty Python’s Flying Circus’. • It can be used to follow both procedural approach and object-oriented approach of programming. • Python has a lot of functionalities which makes it so popular to use.
  • 19. • Artificial intelligence is the trending technology of the future. • We can see so many applications around us. • If we as individuals would also like to develop an AI application, we will need to know a programming language. programming language. • There are various programming languages like Lisp, Prolog, C++, Java and Python, which can be used for developing applications of AI.
  • 20. Python gains a maximum popularity because of the following reasons: • Easy to learn, read and maintain • Python has few keywords, simple structure and a clearly defined syntax. • Python allows anyone to learn the language • Python allows anyone to learn the language quickly. • A program written in Python is fairly easy-to- maintain.
  • 21. • A Broad Standard library • Python has a huge bunch of libraries with plenty of built-in functions to solve a variety of problems. problems.
  • 22. • Interactive Mode • Python has support for an interactive mode which allows interactive testing and debugging of snippets of code. debugging of snippets of code.
  • 23. • Portability and Compatibility • Python can run on a wide variety of operating systems and hardware platforms, and has the same interface on all platforms. same interface on all platforms.
  • 24. • Extendable • We can add low-level modules to the Python interpreter. • These modules enable programmers to add to • These modules enable programmers to add to or customize their tools to be more efficient.
  • 25. Applications of Python • Software Development • Games and 3D Graphics • Database Access • Business Applications • Business Applications • Web and Internet Development • Desktop GUI Applications
  • 26. Python Basics • Printing Statements • We can use Python to display outputs for any code we write. code we write. • To print any statement, we use print() function in Python.
  • 27. • Python Statements and Comments • Instructions written in the source code to execute are known as statements. • These are the lines of code which we write for the computer to work upon. • For example, if we wish to print the addition of two numbers, say 5 and 10, we would of two numbers, say 5 and 10, we would simply write: print(5+10) • This is a Python statement as the computer would go through it and do the needful (which in this case would be to calculate 5+10 and print it on the output screen)
  • 28. • On the other hand, there exist some statements which do not get executed by the computer. • These lines of code are skipped by the machine. • They are known as comments. • Comments are the statements which are incorporated in the code to give a better understanding of code statements to the user. • To write a comment in Python, one can use # and • To write a comment in Python, one can use # and then write anything after it. • For example: • # This is a comment and will not be read by the machine. • print(5+10) # This is a statement and the machine will print the summation.
  • 29. • Keywords & Identifiers • In Python, there exist some words which are pre-defined and carry a specific meaning for the machine by default. • These words are known as keywords. Keywords cannot be changed at any point in time and should not be used any other way time and should not be used any other way except the default one, otherwise they create confusion and might result in ambiguous outputs.
  • 30.
  • 31. • An identifier is any word which is variable. Identifiers can be declared by the user as per their convenience of use and can vary according to the way the user wants. • These words are not defined and can be used in any way. • Keywords cannot be used as identifiers. • Identifiers are also case-sensitive hence an identifier named as Test would be different from an identifier named test.
  • 32. • Variables • A variable is a named location used to store data in the memory. • It is helpful to think of variables as a container that holds data which can be changed later throughout programming. throughout programming. • Just like in Mathematics, in Python too we can use variables to store values in it. • The difference here is, that in Python, the variables not only store numerical values, but can also contain different types of data.
  • 33. • For example: • X = 10 # X variable contains numerical data • Letters = ‘XYZ’ # Letters variable contains alphabetic data • number = 13.95 • number = 13.95 # number variable contains a decimal value • word = ‘k’ # word variable contains a character
  • 34. The rules for naming an identifier in Python are as follows: • The name should begin with – an uppercase or a lowercase alphabet or – an underscore sign (_). This may be followed by any combination of characters a-z, A-Z, 0-9 or underscore (_). Thus, an identifier cannot start with a digit. Thus, an identifier cannot start with a digit. • It can be of any length. (However, it is preferred to keep it short and meaningful). • It should not be a keyword or reserved word . • We cannot use special symbols like !, @, #, $, %, etc. in identifiers .
  • 35. TOKENS IN PYTHON • Smallest individual unit in a program is known as token. • Keywords • Identifiers • Identifiers • Literals • Operators • Punctuators
  • 36.
  • 37. Data Types Data types Specifies which type of value a variable can store. Data Types Numbers (int, Float) Boolean Boolean Tuple List String Set Dictionary
  • 38.
  • 39. • Python inputs • To collect the data from the user at the time of execution, input() function is used. • While using the input function, the datatype of the expected input is required to be mentioned so that the machine does not mentioned so that the machine does not interpret the received data in an incorrect manner • As the data taken as input from the user is considered to be a string (sequence of characters) by default.
  • 40. • Python Operators • Operators are special symbols which represent computation. • They are applied on operand(s), which can be values or variables. • Same operators can behave differently on different data types. different data types. • Operators when applied on operands form an expression. • Operators are categorized as Arithmetic, Relational, Logical and Assignment. • Value and variables when used with operators are known as operands.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45. Expressions • An expression is defined as a combination of constants, variables and operators. • An expression always evaluates to a value. • A value or a standalone variable is also considered as an expression but a standalone considered as an expression but a standalone operator is not an expression. • Some examples of valid expressions are given below. • (i) num – 20.4 (iii) 23/3 -5 * 7*(14 -2) • (ii) 3.0 + 3.14 (iv) "Global"+"Citizen"
  • 46. Give the output of the following when num1 = 5, num2 = 4, num3 = 1 a) num1 += num2 + num3 b) num1 = num1 ** (num2 + num3) c) num1 **= num2 + c d) num1 = '5' + '5' d) num1 = '5' + '5' e) print(4.00/(2.0+2.0)) f) num1 = 2+9*((3*12)-8)/10 g) num1 = float(10) h) num1 = int('3.14')
  • 47. • print('Bye' == 'BYE') • print(10 != 9 and 20 >= 20) • print(10 + 6 * 2 ** 2 != 9//4 -3 and 29>= 29/9) • print(5 % 10 + 10 < 50 and 29 <= 29) • print((0 < 6) or (not(10 == 6) and (10<0)))