SlideShare uma empresa Scribd logo
1 de 31
PYTHON
SUMAN CHANDRA
MCA-5
WHY NAME PYTHON?
 Developed by Van Rossum and named as python to honor British comedy group
Monty python.
Idle was also chosen to honor Eric idle. Monty pythons founding member
WHY PYTHON?
 Faster growing language in terms of:
 Number Of developers who are using it.
 Numbers of library we use.
 Area you can implement it.
 Machine learning , GUI , S/w development , web development , IOT.
 Beginner friendly.
WHY PYTHON?
INTRODUCTION
 Python is easy to learn and use. It is developer-friendly and high level
programming language.
 Python language is more expressive means that it is more understandable and
readable.
Python is compiled and interpreted.
Python can run equally on different platforms such as Windows, Linux, Unix and
Macintosh etc. So, we can say that Python is a portable language.
INTRODUCTION
 Python language is freely available at official web address. The source-code is
also available. Therefore it is open source.
Python has a large and broad library and provides rich set of module and
functions for rapid application development.
It can be easily integrated with languages like C, C++, JAVA etc.
 python have different implementation: PYPY ,CPYTHON ( c ) , IRONPYTHON
(.net), JYTHON (java)
INTRODUCTION
• Python supports multiple programming paradigm
• Functional programming
• Structured programming
• Object oriented programming
• Aspect oriented programming
INSTALLATION
To download and install Python visit the official
website of Python and choose your version.
http://www.python.org/downloads/
Once the download is complete, run the exe
for install Python. Now click on Install Now.
To download and install pycharm (IDE) visit
the official website of jetbrains and choose
your version.
https://www.jetbrains.com/pycharm/download/
PYTHON DATA TYPES
 Integers
There is effectively no limit to how long an integer value can be. Of course, it is
constrained by the amount of memory your system has.
>> print(10)
10
>> x=10
>> Print(x)
10
INTEGER(BINARY , OCTAL , HEXADECIMAL)
Prefix Interpretation Base
0b (zero + lowercase letter 'b')
0B (zero + uppercase letter 'B')
Binary 2
0o (zero + lowercase letter 'o')
0O (zero + uppercase letter 'O')
Octal 8
0x (zero + lowercase letter 'x')
0X (zero + uppercase letter 'X')
Hexadecimal 16
FLOATING POINT NUMBERS
The float type in Python designates a floating-point number. float values are
specified with a decimal point. Optionally, the character e or E followed by a
positive or negative integer may be appended to specify scientific notation:
>>> 4.2
4.2
>>> type(4.2)
<class 'float'>
>>> .4e7
4000000.0
>>> 4.2e-4
0.00042
COMPLEX NUMBERS
Complex numbers are specified as <real part> + <imaginary part> j.
>>> 2+3j
(2+3j)
>>> type(2+3j)
<class 'complex'>
STRING
• Strings are sequences of character data. The string type in Python is called str.
• String literals may be delimited using either single or double quotes. All the
characters between the opening delimiter and matching closing delimiter are part
of the string:
>>> print("I am a string.")
I am a string.
>>> type("I am a string.")
<class 'str‘
>>> print('I am too.')
I am too.
>>> type('I am too.')
<class 'str'>
VARIABLE
• A variable can be seen as a container to store certain values. While the program
is running, variables are accessed and sometimes changed, i.e. a new value will
be assigned to the variable.
• In Java or C, every variable has to be declared before it can be used. Declaring a
variable means binding it to a data type.
• Declaration of variables is not required in Python. If there is need of a variable,
you think of a name and start using it as a variable.
• Another remarkable aspect of Python: Not only the value of a variable may
change during program execution but the type as well.
VARIABLE
i = 42
>>> i = i + 1
>>> print i
43
>>>i = 42 # data type is implicitly set to integer
>>>i = 42 + 0.11 # data type is changed to float
>>>i = "forty" # and now it will be a string
PYTHON OPERATORS
• Python Arithmetic Operators :Arithmetic operators are used with numeric values to
perform common mathematical operations.
• Python Assignment Operators :Assignment operators are used to assign values to
variables.
• Python Comparison Operators :Comparison operators are used to compare two values.
• Python Logical Operators : Logical operators are used to combine conditional
statements.
• Python Identity Operators : Identity operators are used to compare the objects, not if
they are equal, but if they are actually the same object, with the same memory location.
• Python Membership Operators : Membership operators are used to test if a sequence is
presented in an object.
ARITHMETIC OPERATORS
OPERATOR NAME EXAMPLE
+ Addition x + y
- Subtraction x - y
* Multiplication x * y
/ Division x / y
% Modulus x % y
** Exponentiation x ** y
// Floor division x // y
ASSIGNMENT OPERATORS
OPERATOR EXAMPLE SAME AS
= x = 5 x = 5
+= x += 3 x = x + 3
-= x -= 3 x = x - 3
*= x *= 3 x = x * 3
/= x /= 3 x = x / 3
%= x %= 3 x = x % 3
//= x //= 3 x = x // 3
**= x **= 3 x = x ** 3
&= x &= 3 x = x & 3
|= x |= 3 x = x | 3
^= x ^= 3 x = x ^ 3
COMPARISON OPERATORS
Operator Name Example
== Equal x == y
!= Not equal x != y
> Greater than x > y
< Less than x < y
>= Greater than or equal to x >= y
<= Less than or equal to x <= y
IDENTITY OPERATORS
Operator Description Example
is
Returns true if both
variables are the same
object
x is y
is not
Returns true if both
variables are not the
same object
x is not y
MEMBERSHIP OPERATORS
Operator Description Example
in
Returns True if a
sequence with the
specified value is
present in the object
x in y
not in
Returns True if a
sequence with the
specified value is not
present in the object
x not in y
ARRAY
Arrays are used to store multiple values in one single variable.
An array is a special variable, which can hold more than one value at a time.
>>> cars = ["Ford", "Volvo", "BMW"]
>>>print(cars)
['Ford', 'Volvo', 'BMW']
ACCESS THE ELEMENTS OF AN ARRAY
You refer to an array element by referring to the index number.
>>>x = cars[0]
>>>print(x)
Ford
# Modify the value of the first array item:
>>>cars = ["Ford", "Volvo", "BMW"]
>>>cars[0] = "Toyota"
>>>print(cars)
Toyota
THE LENGTH OF AN ARRAY
Use the len() method to return the length of an array (the number of elements in an
array).
>>>cars = ["Ford", "Volvo", "BMW"]
>>>x = len(cars)
>>>print(x)
3
ADDING ARRAY ELEMENTS
You can use the append() method to add an element to an array.
cars = ["Ford", "Volvo", "BMW"]
cars.append("Honda")
print(cars)
['Ford', 'Volvo', 'BMW', 'Honda']
REMOVING ARRAY ELEMENTS
You can use the pop() method to remove an element from the array.
cars = ["Ford", "Volvo", "BMW"]
cars.pop(1)
print(cars)
['Ford', 'BMW']
REMOVING ARRAY ELEMENTS
You can use the pop() method to remove an element from the array
You can also use the remove() method to remove an element from the array.
>>>cars = ["Ford", "Volvo", "BMW"]
>>>cars.pop(1)
>>>print(cars)
['Ford', 'BMW']
>>>cars.remove("BMW")
>>>print(cars)
['Ford‘]
ARRAY METHODS
Method Description
append() Adds an element at the end of the list
clear() Removes all the elements from the list
copy() Returns a copy of the list
count() Returns the number of elements with the specified value
extend()
Add the elements of a list (or any iterable), to the end of the
current list
index() Returns the index of the first element with the specified value
insert() Adds an element at the specified position
pop() Removes the element at the specified position
RECURSION
• In Python, a function is recursive if it calls itself and has a termination condition.?
• Why a termination condition?
• Limitations of recursions:
• Every time a function calls itself and stores some memory. Thus, a recursive
function could hold much more memory than a traditional function. Python stops
the function calls after a depth of 1000 calls.
SOME AMAZING FACTS
• Van Rossum worked for google and dropbox.
• Real life application:
• NETFLIX (75%) , FACEBOOK , AMAZON , YouTube
• Google , Firefox , NASA , IBM , Walt Disney , Drop Box
• Google trends [ oct 6 , 2013 – sep 20 , 2018]
•
PYTHON
JAVA
C
C++
Thank You!

Mais conteúdo relacionado

Mais procurados

Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming KrishnaMildain
 
An Introduction to Python Programming
An Introduction to Python ProgrammingAn Introduction to Python Programming
An Introduction to Python ProgrammingMorteza Zakeri
 
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Edureka!
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming pptismailmrribi
 
Introduction to Basics of Python
Introduction to Basics of PythonIntroduction to Basics of Python
Introduction to Basics of PythonElewayte
 
Variables & Data Types In Python | Edureka
Variables & Data Types In Python | EdurekaVariables & Data Types In Python | Edureka
Variables & Data Types In Python | EdurekaEdureka!
 
Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Paige Bailey
 
What is Python? | Edureka
What is Python? | EdurekaWhat is Python? | Edureka
What is Python? | EdurekaEdureka!
 
Python Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Python Tutorial | Python Tutorial for Beginners | Python Training | EdurekaPython Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Python Tutorial | Python Tutorial for Beginners | Python Training | EdurekaEdureka!
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Pedro Rodrigues
 
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Learn Python Programming | Python Programming - Step by Step | Python for Beg...Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Learn Python Programming | Python Programming - Step by Step | Python for Beg...Edureka!
 
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...Edureka!
 

Mais procurados (20)

Python
PythonPython
Python
 
Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming
 
An Introduction to Python Programming
An Introduction to Python ProgrammingAn Introduction to Python Programming
An Introduction to Python Programming
 
Introduction of python
Introduction of pythonIntroduction of python
Introduction of python
 
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...
 
Begin with Python
Begin with PythonBegin with Python
Begin with Python
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming ppt
 
Introduction to Basics of Python
Introduction to Basics of PythonIntroduction to Basics of Python
Introduction to Basics of Python
 
Python
PythonPython
Python
 
Variables & Data Types In Python | Edureka
Variables & Data Types In Python | EdurekaVariables & Data Types In Python | Edureka
Variables & Data Types In Python | Edureka
 
Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)
 
Python programming
Python  programmingPython  programming
Python programming
 
Programming with Python
Programming with PythonProgramming with Python
Programming with Python
 
What is Python? | Edureka
What is Python? | EdurekaWhat is Python? | Edureka
What is Python? | Edureka
 
Python Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Python Tutorial | Python Tutorial for Beginners | Python Training | EdurekaPython Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Python Tutorial | Python Tutorial for Beginners | Python Training | Edureka
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)
 
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Learn Python Programming | Python Programming - Step by Step | Python for Beg...Learn Python Programming | Python Programming - Step by Step | Python for Beg...
Learn Python Programming | Python Programming - Step by Step | Python for Beg...
 
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
 
Python Basics
Python BasicsPython Basics
Python Basics
 

Semelhante a Python

modul-python-all.pptx
modul-python-all.pptxmodul-python-all.pptx
modul-python-all.pptxYusuf Ayuba
 
Python Basics by Akanksha Bali
Python Basics by Akanksha BaliPython Basics by Akanksha Bali
Python Basics by Akanksha BaliAkanksha Bali
 
Basic concept of Python.pptx includes design tool, identifier, variables.
Basic concept of Python.pptx includes design tool, identifier, variables.Basic concept of Python.pptx includes design tool, identifier, variables.
Basic concept of Python.pptx includes design tool, identifier, variables.supriyasarkar38
 
An overview on python commands for solving the problems
An overview on python commands for solving the problemsAn overview on python commands for solving the problems
An overview on python commands for solving the problemsRavikiran708913
 
Python (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualizePython (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualizeIruolagbePius
 
1_Python Basics.pdf
1_Python Basics.pdf1_Python Basics.pdf
1_Python Basics.pdfMaheshGour5
 
TOPIC-2-Expression Variable Assignment Statement.pdf
TOPIC-2-Expression Variable Assignment Statement.pdfTOPIC-2-Expression Variable Assignment Statement.pdf
TOPIC-2-Expression Variable Assignment Statement.pdfEjazAlam23
 
Python introduction towards data science
Python introduction towards data sciencePython introduction towards data science
Python introduction towards data sciencedeepak teja
 
Python For Data Science.pptx
Python For Data Science.pptxPython For Data Science.pptx
Python For Data Science.pptxrohithprabhas1
 
Python_Haegl.powerpoint presentation. tx
Python_Haegl.powerpoint presentation. txPython_Haegl.powerpoint presentation. tx
Python_Haegl.powerpoint presentation. txvishwanathgoudapatil1
 
Python PPT by Sushil Sir.pptx
Python PPT by Sushil Sir.pptxPython PPT by Sushil Sir.pptx
Python PPT by Sushil Sir.pptxsushil155005
 
01-Python-Basics.ppt
01-Python-Basics.ppt01-Python-Basics.ppt
01-Python-Basics.pptVicVic56
 
Python-01| Fundamentals
Python-01| FundamentalsPython-01| Fundamentals
Python-01| FundamentalsMohd Sajjad
 

Semelhante a Python (20)

modul-python-all.pptx
modul-python-all.pptxmodul-python-all.pptx
modul-python-all.pptx
 
Python basics
Python basicsPython basics
Python basics
 
Python Basics by Akanksha Bali
Python Basics by Akanksha BaliPython Basics by Akanksha Bali
Python Basics by Akanksha Bali
 
Basic concept of Python.pptx includes design tool, identifier, variables.
Basic concept of Python.pptx includes design tool, identifier, variables.Basic concept of Python.pptx includes design tool, identifier, variables.
Basic concept of Python.pptx includes design tool, identifier, variables.
 
An overview on python commands for solving the problems
An overview on python commands for solving the problemsAn overview on python commands for solving the problems
An overview on python commands for solving the problems
 
Welcome to python workshop
Welcome to python workshopWelcome to python workshop
Welcome to python workshop
 
Python.pptx
Python.pptxPython.pptx
Python.pptx
 
Python (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualizePython (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualize
 
Python fundamentals
Python fundamentalsPython fundamentals
Python fundamentals
 
Python
PythonPython
Python
 
Introduction to Python
Introduction to Python  Introduction to Python
Introduction to Python
 
1_Python Basics.pdf
1_Python Basics.pdf1_Python Basics.pdf
1_Python Basics.pdf
 
TOPIC-2-Expression Variable Assignment Statement.pdf
TOPIC-2-Expression Variable Assignment Statement.pdfTOPIC-2-Expression Variable Assignment Statement.pdf
TOPIC-2-Expression Variable Assignment Statement.pdf
 
Python introduction towards data science
Python introduction towards data sciencePython introduction towards data science
Python introduction towards data science
 
Python For Data Science.pptx
Python For Data Science.pptxPython For Data Science.pptx
Python For Data Science.pptx
 
Python_Haegl.powerpoint presentation. tx
Python_Haegl.powerpoint presentation. txPython_Haegl.powerpoint presentation. tx
Python_Haegl.powerpoint presentation. tx
 
Python PPT by Sushil Sir.pptx
Python PPT by Sushil Sir.pptxPython PPT by Sushil Sir.pptx
Python PPT by Sushil Sir.pptx
 
01-Python-Basics.ppt
01-Python-Basics.ppt01-Python-Basics.ppt
01-Python-Basics.ppt
 
Python for Beginners(v1)
Python for Beginners(v1)Python for Beginners(v1)
Python for Beginners(v1)
 
Python-01| Fundamentals
Python-01| FundamentalsPython-01| Fundamentals
Python-01| Fundamentals
 

Último

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 

Último (20)

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 

Python

  • 2. WHY NAME PYTHON?  Developed by Van Rossum and named as python to honor British comedy group Monty python. Idle was also chosen to honor Eric idle. Monty pythons founding member
  • 3. WHY PYTHON?  Faster growing language in terms of:  Number Of developers who are using it.  Numbers of library we use.  Area you can implement it.  Machine learning , GUI , S/w development , web development , IOT.  Beginner friendly.
  • 5. INTRODUCTION  Python is easy to learn and use. It is developer-friendly and high level programming language.  Python language is more expressive means that it is more understandable and readable. Python is compiled and interpreted. Python can run equally on different platforms such as Windows, Linux, Unix and Macintosh etc. So, we can say that Python is a portable language.
  • 6. INTRODUCTION  Python language is freely available at official web address. The source-code is also available. Therefore it is open source. Python has a large and broad library and provides rich set of module and functions for rapid application development. It can be easily integrated with languages like C, C++, JAVA etc.  python have different implementation: PYPY ,CPYTHON ( c ) , IRONPYTHON (.net), JYTHON (java)
  • 7. INTRODUCTION • Python supports multiple programming paradigm • Functional programming • Structured programming • Object oriented programming • Aspect oriented programming
  • 8. INSTALLATION To download and install Python visit the official website of Python and choose your version. http://www.python.org/downloads/ Once the download is complete, run the exe for install Python. Now click on Install Now. To download and install pycharm (IDE) visit the official website of jetbrains and choose your version. https://www.jetbrains.com/pycharm/download/
  • 9. PYTHON DATA TYPES  Integers There is effectively no limit to how long an integer value can be. Of course, it is constrained by the amount of memory your system has. >> print(10) 10 >> x=10 >> Print(x) 10
  • 10. INTEGER(BINARY , OCTAL , HEXADECIMAL) Prefix Interpretation Base 0b (zero + lowercase letter 'b') 0B (zero + uppercase letter 'B') Binary 2 0o (zero + lowercase letter 'o') 0O (zero + uppercase letter 'O') Octal 8 0x (zero + lowercase letter 'x') 0X (zero + uppercase letter 'X') Hexadecimal 16
  • 11. FLOATING POINT NUMBERS The float type in Python designates a floating-point number. float values are specified with a decimal point. Optionally, the character e or E followed by a positive or negative integer may be appended to specify scientific notation: >>> 4.2 4.2 >>> type(4.2) <class 'float'> >>> .4e7 4000000.0 >>> 4.2e-4 0.00042
  • 12. COMPLEX NUMBERS Complex numbers are specified as <real part> + <imaginary part> j. >>> 2+3j (2+3j) >>> type(2+3j) <class 'complex'>
  • 13. STRING • Strings are sequences of character data. The string type in Python is called str. • String literals may be delimited using either single or double quotes. All the characters between the opening delimiter and matching closing delimiter are part of the string: >>> print("I am a string.") I am a string. >>> type("I am a string.") <class 'str‘ >>> print('I am too.') I am too. >>> type('I am too.') <class 'str'>
  • 14. VARIABLE • A variable can be seen as a container to store certain values. While the program is running, variables are accessed and sometimes changed, i.e. a new value will be assigned to the variable. • In Java or C, every variable has to be declared before it can be used. Declaring a variable means binding it to a data type. • Declaration of variables is not required in Python. If there is need of a variable, you think of a name and start using it as a variable. • Another remarkable aspect of Python: Not only the value of a variable may change during program execution but the type as well.
  • 15. VARIABLE i = 42 >>> i = i + 1 >>> print i 43 >>>i = 42 # data type is implicitly set to integer >>>i = 42 + 0.11 # data type is changed to float >>>i = "forty" # and now it will be a string
  • 16. PYTHON OPERATORS • Python Arithmetic Operators :Arithmetic operators are used with numeric values to perform common mathematical operations. • Python Assignment Operators :Assignment operators are used to assign values to variables. • Python Comparison Operators :Comparison operators are used to compare two values. • Python Logical Operators : Logical operators are used to combine conditional statements. • Python Identity Operators : Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location. • Python Membership Operators : Membership operators are used to test if a sequence is presented in an object.
  • 17. ARITHMETIC OPERATORS OPERATOR NAME EXAMPLE + Addition x + y - Subtraction x - y * Multiplication x * y / Division x / y % Modulus x % y ** Exponentiation x ** y // Floor division x // y
  • 18. ASSIGNMENT OPERATORS OPERATOR EXAMPLE SAME AS = x = 5 x = 5 += x += 3 x = x + 3 -= x -= 3 x = x - 3 *= x *= 3 x = x * 3 /= x /= 3 x = x / 3 %= x %= 3 x = x % 3 //= x //= 3 x = x // 3 **= x **= 3 x = x ** 3 &= x &= 3 x = x & 3 |= x |= 3 x = x | 3 ^= x ^= 3 x = x ^ 3
  • 19. COMPARISON OPERATORS Operator Name Example == Equal x == y != Not equal x != y > Greater than x > y < Less than x < y >= Greater than or equal to x >= y <= Less than or equal to x <= y
  • 20. IDENTITY OPERATORS Operator Description Example is Returns true if both variables are the same object x is y is not Returns true if both variables are not the same object x is not y
  • 21. MEMBERSHIP OPERATORS Operator Description Example in Returns True if a sequence with the specified value is present in the object x in y not in Returns True if a sequence with the specified value is not present in the object x not in y
  • 22. ARRAY Arrays are used to store multiple values in one single variable. An array is a special variable, which can hold more than one value at a time. >>> cars = ["Ford", "Volvo", "BMW"] >>>print(cars) ['Ford', 'Volvo', 'BMW']
  • 23. ACCESS THE ELEMENTS OF AN ARRAY You refer to an array element by referring to the index number. >>>x = cars[0] >>>print(x) Ford # Modify the value of the first array item: >>>cars = ["Ford", "Volvo", "BMW"] >>>cars[0] = "Toyota" >>>print(cars) Toyota
  • 24. THE LENGTH OF AN ARRAY Use the len() method to return the length of an array (the number of elements in an array). >>>cars = ["Ford", "Volvo", "BMW"] >>>x = len(cars) >>>print(x) 3
  • 25. ADDING ARRAY ELEMENTS You can use the append() method to add an element to an array. cars = ["Ford", "Volvo", "BMW"] cars.append("Honda") print(cars) ['Ford', 'Volvo', 'BMW', 'Honda']
  • 26. REMOVING ARRAY ELEMENTS You can use the pop() method to remove an element from the array. cars = ["Ford", "Volvo", "BMW"] cars.pop(1) print(cars) ['Ford', 'BMW']
  • 27. REMOVING ARRAY ELEMENTS You can use the pop() method to remove an element from the array You can also use the remove() method to remove an element from the array. >>>cars = ["Ford", "Volvo", "BMW"] >>>cars.pop(1) >>>print(cars) ['Ford', 'BMW'] >>>cars.remove("BMW") >>>print(cars) ['Ford‘]
  • 28. ARRAY METHODS Method Description append() Adds an element at the end of the list clear() Removes all the elements from the list copy() Returns a copy of the list count() Returns the number of elements with the specified value extend() Add the elements of a list (or any iterable), to the end of the current list index() Returns the index of the first element with the specified value insert() Adds an element at the specified position pop() Removes the element at the specified position
  • 29. RECURSION • In Python, a function is recursive if it calls itself and has a termination condition.? • Why a termination condition? • Limitations of recursions: • Every time a function calls itself and stores some memory. Thus, a recursive function could hold much more memory than a traditional function. Python stops the function calls after a depth of 1000 calls.
  • 30. SOME AMAZING FACTS • Van Rossum worked for google and dropbox. • Real life application: • NETFLIX (75%) , FACEBOOK , AMAZON , YouTube • Google , Firefox , NASA , IBM , Walt Disney , Drop Box • Google trends [ oct 6 , 2013 – sep 20 , 2018] • PYTHON JAVA C C++