SlideShare une entreprise Scribd logo
1  sur  18
Seminar Presentation
On
Python: Basic
Submitted By:-
Sohil Sundaram
BCA – 5th
Roll No. 66
Submitted To:-
Mr. Ashish Pal
1
: INTRODUCTION :
Early in 1980 by Guido Van Rossum.
High-level, Hybrid Object Oriented, Scripting language.
Open-source.
Areas: Biology, Data Science, Geography, Language Processing etc.
Framework like SciPy, Django, Pyramid, Flask, Bottle, PyGame, Ipython, Pandas.
Standard library supports HTML, XML, JSON, Email, FTP etc.
2
: Features :
• Simple, Easy to learn.
• Free and Open Source.
• High-level, Portable.
• Interpreted, Object-Oriented.
• Extensible, Embeddable.
• Extensive Libraries.
3
: Java vs Python :
Dynamic vs Static Typing.
Object Orientation Methodology.
Braces vs Indentation.
Speed and Portability.
Distributed vs Concentrated.
4
: Java vs Python :
::: Example :::
• Java:
public class A
{
public static void main(String args[])
{
System.out.println(“Hello World”);
}
}
• Python:
>>>print (“Hello World”)
5
: IO and Variables:
Take input as:
var_name = input(“Enter
Name: ”)
>>> Enter Name: Sohil
Print output:
print (var_name)
>>> Sohil
var_name = input(“Enter Name: ”)
>>> Enter Name: Sohil
>>> print (type(var_name))
>>> <class ‘str’>
6
: Collective Elements I:
• List: Comma separated, diff data type, Mutable.
list1 = [‘Phy’ , ‘Che’ , 20, 30]
print(list1[1]) #Che
• Tuples: Sequence, Immutable, use of parentheses.
tup1 = (‘Phy’ , ‘Che’ , 20 , 30)
print(tup1[2]) #20
7
: Collective Elements II:
• Dictionary: Mutable, Container type, Pair of Key and Value.
dict1 = {‘Alice’ : ‘20’ , ‘Beth’ : ‘22’ , ‘Jordon’ : ‘23’}
print(dict1[‘Alice’]) #20
• Sets: Unordered collection, no duplicates, supports mathematical
operations.
set1 = {‘apple’ , ‘banana’ , ‘orange’ , ‘banana’ , ‘pear’}
print(set1) #{‘apple’ , ‘orange’, ‘banana’ , ‘pear’}
8
::: Operator :::
• Operation on String:
a = “Hello, ”
b = “How are you?”
c = a + b
print(c) #Hello, How are you?
• Operation on Numbers:
a = 6
b = 7
print(c) # 13
Expression = Operator(s) + Operand(s).
9
: Conditional :
• if statement
• if-else statement
• if – elif – else statement
a = int(input(“Enter Number: ”))
if a%2==0:
print(“Even”)
else:
print(“Odd”)
10
::: Looping :::
‘for loop’
for i in range(1,6):
print(i + end = “ ”)
else:
print(“End”)
>>> 1 2 3 4 5 End
‘while loop’
a = 1
while(a<5):
print(a + “ ”)
a++
>>> 1 2 3 4
11
: Function :
• Group of statement that together performs a specific task.
• Defined using ‘def’ keyword.
• Syntax: def functionName():
# Function Body
• Ex: def printName(): # Function Definition
print(“Sohil”) # Function Body
printName() # Function Call
12
::: Object Orientation :::
• Class: User-defined data type (think of), logical.
• Object: Physical reality of class.
person1(Object) Person(Class)
first_name(Field)
last_name(Field)
Sohil
Sundaram
printName()(Method)
13
::: OOPS Example :::
Class Table: # Class Declaration
def printTable(self): # Class Method
x = 5
for i in range(1,11,2): # For loop
print(x*i + end = ‘ ’)
pT = Table( ) # Object Creation
pT.printTable( ) # Method Calling
Output: 5 15 25 35 45
14
:: Inheritance ::
• Phenomena of Object Oriented Language.
• Base class is ‘object’.
• Syntax: class SuperClass: # Parent Class
pass
class SubClass(SuperClass): # Child Class
pass
* pass is used to describe that block contains nothing and it is just for demonstration.
15
: Inheritance Example :
16
class Employee(Person):
pass
emp = Person(“Sohil”)
print(emp.getName( ))
emp = Employee(“Sundaram”)
print(emp.getName( ))
class Person(object):
def __init__(self, name):
self.name = name
def get Name(self):
return self.name
def isEmployee(self):
return false
:: Conclusion ::
• Accessible for beginners.
• Growing Demand.
• Used in mass functional areas like Google, YouTube, Facebook etc.
• Replacing Java in many areas.
• Rich and Diverse Library.
17
Thanks !!!
18

Contenu connexe

Tendances

Python programming introduction
Python programming introductionPython programming introduction
Python programming introductionSiddique Ibrahim
 
Python, the Language of Science and Engineering for Engineers
Python, the Language of Science and Engineering for EngineersPython, the Language of Science and Engineering for Engineers
Python, the Language of Science and Engineering for EngineersBoey Pak Cheong
 
Intro to Python for Non-Programmers
Intro to Python for Non-ProgrammersIntro to Python for Non-Programmers
Intro to Python for Non-ProgrammersAhmad Alhour
 
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
 
Python quick guide1
Python quick guide1Python quick guide1
Python quick guide1Kanchilug
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming pptismailmrribi
 
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAChapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAMaulik Borsaniya
 
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
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonAgung Wahyudi
 
Basic Concepts in Python
Basic Concepts in PythonBasic Concepts in Python
Basic Concepts in PythonSumit Satam
 
Full Python in 20 slides
Full Python in 20 slidesFull Python in 20 slides
Full Python in 20 slidesrfojdar
 
Python | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python TutorialPython | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python TutorialQA TrainingHub
 
programming with python ppt
programming with python pptprogramming with python ppt
programming with python pptPriyanka Pradhan
 
Intro to Python Programming Language
Intro to Python Programming LanguageIntro to Python Programming Language
Intro to Python Programming LanguageDipankar Achinta
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythoneShikshak
 

Tendances (20)

Python programming introduction
Python programming introductionPython programming introduction
Python programming introduction
 
Python, the Language of Science and Engineering for Engineers
Python, the Language of Science and Engineering for EngineersPython, the Language of Science and Engineering for Engineers
Python, the Language of Science and Engineering for Engineers
 
Intro to Python for Non-Programmers
Intro to Python for Non-ProgrammersIntro to Python for Non-Programmers
Intro to Python for Non-Programmers
 
Introduction python
Introduction pythonIntroduction python
Introduction 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)
 
Python Tutorial Part 1
Python Tutorial Part 1Python Tutorial Part 1
Python Tutorial Part 1
 
Python quick guide1
Python quick guide1Python quick guide1
Python quick guide1
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming ppt
 
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAChapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
 
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)
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Basic Concepts in Python
Basic Concepts in PythonBasic Concepts in Python
Basic Concepts in Python
 
Full Python in 20 slides
Full Python in 20 slidesFull Python in 20 slides
Full Python in 20 slides
 
Python | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python TutorialPython | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python Tutorial
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
 
programming with python ppt
programming with python pptprogramming with python ppt
programming with python ppt
 
Python Functions
Python   FunctionsPython   Functions
Python Functions
 
Python Modules
Python ModulesPython Modules
Python Modules
 
Intro to Python Programming Language
Intro to Python Programming LanguageIntro to Python Programming Language
Intro to Python Programming Language
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 

Similaire à Python Basics Seminar Presentation by Sohil Sundaram

Clojure/conj 2017
Clojure/conj 2017Clojure/conj 2017
Clojure/conj 2017Darren Kim
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojureAbbas Raza
 
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...DRVaibhavmeshram1
 
Becoming a Pythonist
Becoming a PythonistBecoming a Pythonist
Becoming a PythonistRaji Engg
 
Pydiomatic
PydiomaticPydiomatic
Pydiomaticrik0
 
Presentation of Python, Django, DockerStack
Presentation of Python, Django, DockerStackPresentation of Python, Django, DockerStack
Presentation of Python, Django, DockerStackDavid Sanchez
 
Peter Norvig - NYC Machine Learning 2013
Peter Norvig - NYC Machine Learning 2013Peter Norvig - NYC Machine Learning 2013
Peter Norvig - NYC Machine Learning 2013Michael Scovetta
 
Python Programming for ArcGIS: Part I
Python Programming for ArcGIS: Part IPython Programming for ArcGIS: Part I
Python Programming for ArcGIS: Part IDUSPviz
 
An Intro to Python in 30 minutes
An Intro to Python in 30 minutesAn Intro to Python in 30 minutes
An Intro to Python in 30 minutesSumit Raj
 
A Head Start on Python Language
A Head Start on Python Language A Head Start on Python Language
A Head Start on Python Language saggi_decembre
 

Similaire à Python Basics Seminar Presentation by Sohil Sundaram (20)

Clojure/conj 2017
Clojure/conj 2017Clojure/conj 2017
Clojure/conj 2017
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojure
 
Python_intro.ppt
Python_intro.pptPython_intro.ppt
Python_intro.ppt
 
Dynamic Python
Dynamic PythonDynamic Python
Dynamic Python
 
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Python in 90 minutes
Python in 90 minutesPython in 90 minutes
Python in 90 minutes
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Becoming a Pythonist
Becoming a PythonistBecoming a Pythonist
Becoming a Pythonist
 
2015 555 kharchenko_ppt
2015 555 kharchenko_ppt2015 555 kharchenko_ppt
2015 555 kharchenko_ppt
 
Pydiomatic
PydiomaticPydiomatic
Pydiomatic
 
Python idiomatico
Python idiomaticoPython idiomatico
Python idiomatico
 
Presentation of Python, Django, DockerStack
Presentation of Python, Django, DockerStackPresentation of Python, Django, DockerStack
Presentation of Python, Django, DockerStack
 
Python - Lecture 9
Python - Lecture 9Python - Lecture 9
Python - Lecture 9
 
Python Kick Start
Python Kick StartPython Kick Start
Python Kick Start
 
Peter Norvig - NYC Machine Learning 2013
Peter Norvig - NYC Machine Learning 2013Peter Norvig - NYC Machine Learning 2013
Peter Norvig - NYC Machine Learning 2013
 
Python Programming for ArcGIS: Part I
Python Programming for ArcGIS: Part IPython Programming for ArcGIS: Part I
Python Programming for ArcGIS: Part I
 
An Intro to Python in 30 minutes
An Intro to Python in 30 minutesAn Intro to Python in 30 minutes
An Intro to Python in 30 minutes
 
Python 101
Python 101Python 101
Python 101
 
A Head Start on Python Language
A Head Start on Python Language A Head Start on Python Language
A Head Start on Python Language
 

Dernier

Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 

Dernier (20)

Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 

Python Basics Seminar Presentation by Sohil Sundaram

  • 1. Seminar Presentation On Python: Basic Submitted By:- Sohil Sundaram BCA – 5th Roll No. 66 Submitted To:- Mr. Ashish Pal 1
  • 2. : INTRODUCTION : Early in 1980 by Guido Van Rossum. High-level, Hybrid Object Oriented, Scripting language. Open-source. Areas: Biology, Data Science, Geography, Language Processing etc. Framework like SciPy, Django, Pyramid, Flask, Bottle, PyGame, Ipython, Pandas. Standard library supports HTML, XML, JSON, Email, FTP etc. 2
  • 3. : Features : • Simple, Easy to learn. • Free and Open Source. • High-level, Portable. • Interpreted, Object-Oriented. • Extensible, Embeddable. • Extensive Libraries. 3
  • 4. : Java vs Python : Dynamic vs Static Typing. Object Orientation Methodology. Braces vs Indentation. Speed and Portability. Distributed vs Concentrated. 4
  • 5. : Java vs Python : ::: Example ::: • Java: public class A { public static void main(String args[]) { System.out.println(“Hello World”); } } • Python: >>>print (“Hello World”) 5
  • 6. : IO and Variables: Take input as: var_name = input(“Enter Name: ”) >>> Enter Name: Sohil Print output: print (var_name) >>> Sohil var_name = input(“Enter Name: ”) >>> Enter Name: Sohil >>> print (type(var_name)) >>> <class ‘str’> 6
  • 7. : Collective Elements I: • List: Comma separated, diff data type, Mutable. list1 = [‘Phy’ , ‘Che’ , 20, 30] print(list1[1]) #Che • Tuples: Sequence, Immutable, use of parentheses. tup1 = (‘Phy’ , ‘Che’ , 20 , 30) print(tup1[2]) #20 7
  • 8. : Collective Elements II: • Dictionary: Mutable, Container type, Pair of Key and Value. dict1 = {‘Alice’ : ‘20’ , ‘Beth’ : ‘22’ , ‘Jordon’ : ‘23’} print(dict1[‘Alice’]) #20 • Sets: Unordered collection, no duplicates, supports mathematical operations. set1 = {‘apple’ , ‘banana’ , ‘orange’ , ‘banana’ , ‘pear’} print(set1) #{‘apple’ , ‘orange’, ‘banana’ , ‘pear’} 8
  • 9. ::: Operator ::: • Operation on String: a = “Hello, ” b = “How are you?” c = a + b print(c) #Hello, How are you? • Operation on Numbers: a = 6 b = 7 print(c) # 13 Expression = Operator(s) + Operand(s). 9
  • 10. : Conditional : • if statement • if-else statement • if – elif – else statement a = int(input(“Enter Number: ”)) if a%2==0: print(“Even”) else: print(“Odd”) 10
  • 11. ::: Looping ::: ‘for loop’ for i in range(1,6): print(i + end = “ ”) else: print(“End”) >>> 1 2 3 4 5 End ‘while loop’ a = 1 while(a<5): print(a + “ ”) a++ >>> 1 2 3 4 11
  • 12. : Function : • Group of statement that together performs a specific task. • Defined using ‘def’ keyword. • Syntax: def functionName(): # Function Body • Ex: def printName(): # Function Definition print(“Sohil”) # Function Body printName() # Function Call 12
  • 13. ::: Object Orientation ::: • Class: User-defined data type (think of), logical. • Object: Physical reality of class. person1(Object) Person(Class) first_name(Field) last_name(Field) Sohil Sundaram printName()(Method) 13
  • 14. ::: OOPS Example ::: Class Table: # Class Declaration def printTable(self): # Class Method x = 5 for i in range(1,11,2): # For loop print(x*i + end = ‘ ’) pT = Table( ) # Object Creation pT.printTable( ) # Method Calling Output: 5 15 25 35 45 14
  • 15. :: Inheritance :: • Phenomena of Object Oriented Language. • Base class is ‘object’. • Syntax: class SuperClass: # Parent Class pass class SubClass(SuperClass): # Child Class pass * pass is used to describe that block contains nothing and it is just for demonstration. 15
  • 16. : Inheritance Example : 16 class Employee(Person): pass emp = Person(“Sohil”) print(emp.getName( )) emp = Employee(“Sundaram”) print(emp.getName( )) class Person(object): def __init__(self, name): self.name = name def get Name(self): return self.name def isEmployee(self): return false
  • 17. :: Conclusion :: • Accessible for beginners. • Growing Demand. • Used in mass functional areas like Google, YouTube, Facebook etc. • Replacing Java in many areas. • Rich and Diverse Library. 17