SlideShare a Scribd company logo
Intro to Python CSSU Nov/28/2007 By Georgi Petrov & Atanas Dyulgerov
Outline What is Python Python Advantages Who uses Python Syntax & Semantics Data Structures Python Standard Library Demo 1 Object Orientation Demo 2
What is Python? interpreted, interactive, object-oriented  programming language  Widely used in the industry Cousin of Tcl, Perl and VB Used in web programming and in standalone applications
Python Advantages Elegant syntax Safe Object-oriented Powerful Portable Free
Python is simple print &quot;Hello World!&quot; #include <iostream.h>  int main()  {  cout << &quot;Hello World!&quot;;  } public class helloWorld  {  public static void main(String [] args)  {  System.out.println(&quot;Hello World!&quot;);  }  } Python C++ Java
Python is fun & practical Lack of type declaration Huge library of modules Widespread use in industry Available for all the major platforms (Windows, MacOS, Linux, Unix, BeOS, Java)
Who uses Python Google NASA Rackspace Industrial Light & Magic
Syntax - Indentation
Syntax - Operators Comparison Operators ==,  <,  >,  <=,  >= Logical Operators Zero values are treated as “”, 0, None, 0.0, [] and {}
Data Structures Base Types integer, float, long integer, octal integer, hexadecimal integer, complex, character string, list, dictionary, tuples, file Collection types sequences & mappings Object system
Python Standard Library The greatest strengths of Python Hundreds of modules Examples Syntax:  import   email email ,  math ,  calendar ,  HTMLParser
Object Oriented Mechanism Similar to C++ and Java Supports multiple inheritance Polymorphism No private class  members   class Stack:  def __init__(self,size): self.data = [None]*size self.size = 0   def push(self,item): self.data[self.size] = item self.size = self.size + 1    def pop(self): self.size = self.size - 1 return self.data[self.size]    def is_empty(self): return self.size == 0   def is_full(self):  return self.size == len(self.data)
Demo 1 Adjusting Apache to read Python Sample “Hello World” script
Object Orientation Defining classes class SomeClass:   &quot;Just some class...that's all.&quot; Adding data members and methods class SomeClass   &quot;Just some class...that's all.&quot; someNumber = 2131 def someFunction ( self ): return someNumber
Object Orientation Self Instantiating myObject = myClass() ‏ Calling and addressing myObject.someFunction() ‏ Deletion del myObject.someNumber
Object Orientation Constructors class AnotherClass: def __init__ ( self, anotherArgument ): self.anotherArgument = anotherArgument Single/Multiple Inheritance and Overriding class ParentClass: def print( self ): print “parent” class ChildClass ( ParentClass ): def print( self ): print “child”
Demo  2 Brief networking info Sockets SocketServer  Framework Ports and Addresses Demo
References http://wiki.python.org http://www.python.org/ http://en.wikipedia.org/wiki/Python_(programming_language)
Thank You Q & A

More Related Content

PPT
Introduction to python
ODP
Pythonpresent
PPTX
Introduction Jupyter Notebook
PDF
The Benefits of Type Hints
PPTX
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
PPTX
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
PDF
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
PDF
Numba: Array-oriented Python Compiler for NumPy
Introduction to python
Pythonpresent
Introduction Jupyter Notebook
The Benefits of Type Hints
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Numba: Array-oriented Python Compiler for NumPy

What's hot (20)

PDF
Why Python (for Statisticians)
PDF
Zero to Hero - Introduction to Python3
PDF
Python basics_ part1
PDF
PyCon 2013 : Scripting to PyPi to GitHub and More
PDF
PuppetConf 2017: Puppet Platform: A Path Forward- Eric Sorenson, Puppet
PPTX
Python basic
PPT
Python ppt
PPTX
Python introduction
ODP
Python and Machine Learning
PDF
Chapter 0 Python Overview (Python Programming Lecture)
PPTX
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
PPT
Introduction to python
PPT
Python Introduction
PPTX
Python with data Sciences
PDF
Python Workshop
PPTX
Python Libraries and Modules
PDF
Introduction to IPython & Jupyter Notebooks
PPTX
Python Tutorial Part 1
PDF
Introduction to python 3
PDF
Intro to Python for Non-Programmers
Why Python (for Statisticians)
Zero to Hero - Introduction to Python3
Python basics_ part1
PyCon 2013 : Scripting to PyPi to GitHub and More
PuppetConf 2017: Puppet Platform: A Path Forward- Eric Sorenson, Puppet
Python basic
Python ppt
Python introduction
Python and Machine Learning
Chapter 0 Python Overview (Python Programming Lecture)
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Introduction to python
Python Introduction
Python with data Sciences
Python Workshop
Python Libraries and Modules
Introduction to IPython & Jupyter Notebooks
Python Tutorial Part 1
Introduction to python 3
Intro to Python for Non-Programmers
Ad

Similar to Intro to Python (20)

PPT
Zpugdccherry 101105081729-phpapp01
PDF
Python and Pytorch tutorial and walkthrough
ODP
Programming Under Linux In Python
PPT
Mufix Network Programming Lecture
PDF
Python Foundation – A programmer's introduction to Python concepts & style
PDF
Python (3).pdf
PPTX
Python for dummies
ODP
Intro To Spring Python
PDF
First Steps in Python Programming
ODP
Dynamic Python
PPT
Groovy Introduction - JAX Germany - 2008
PPTX
Introduction to Google App Engine with Python
PDF
Python Workshop Day - 2 (REVA University)
PDF
EKON 25 Python4Delphi_mX4
PPTX
Docketrun's Python Course for beginners.pptx
KEY
Charming python
PPTX
.NET 4 Demystified - Sandeep Joshi
PPTX
Python 101 for the .NET Developer
ODP
Python Presentation
PPTX
Python programming workshop session 1
Zpugdccherry 101105081729-phpapp01
Python and Pytorch tutorial and walkthrough
Programming Under Linux In Python
Mufix Network Programming Lecture
Python Foundation – A programmer's introduction to Python concepts & style
Python (3).pdf
Python for dummies
Intro To Spring Python
First Steps in Python Programming
Dynamic Python
Groovy Introduction - JAX Germany - 2008
Introduction to Google App Engine with Python
Python Workshop Day - 2 (REVA University)
EKON 25 Python4Delphi_mX4
Docketrun's Python Course for beginners.pptx
Charming python
.NET 4 Demystified - Sandeep Joshi
Python 101 for the .NET Developer
Python Presentation
Python programming workshop session 1
Ad

Recently uploaded (20)

PDF
Dr. Enrique Segura Ense Group - A Self-Made Entrepreneur And Executive
PDF
DOC-20250806-WA0002._20250806_112011_0000.pdf
PDF
20250805_A. Stotz All Weather Strategy - Performance review July 2025.pdf
PDF
BsN 7th Sem Course GridNNNNNNNN CCN.pdf
PDF
Business model innovation report 2022.pdf
PPTX
Probability Distribution, binomial distribution, poisson distribution
PPTX
Amazon (Business Studies) management studies
PPTX
ICG2025_ICG 6th steering committee 30-8-24.pptx
PDF
Laughter Yoga Basic Learning Workshop Manual
PPTX
The Marketing Journey - Tracey Phillips - Marketing Matters 7-2025.pptx
PDF
Reconciliation AND MEMORANDUM RECONCILATION
PPTX
Dragon_Fruit_Cultivation_in Nepal ppt.pptx
PPTX
AI-assistance in Knowledge Collection and Curation supporting Safe and Sustai...
DOCX
unit 1 COST ACCOUNTING AND COST SHEET
PDF
kom-180-proposal-for-a-directive-amending-directive-2014-45-eu-and-directive-...
PDF
Roadmap Map-digital Banking feature MB,IB,AB
PPTX
Lecture (1)-Introduction.pptx business communication
DOCX
unit 2 cost accounting- Tender and Quotation & Reconciliation Statement
DOCX
Business Management - unit 1 and 2
PDF
Katrina Stoneking: Shaking Up the Alcohol Beverage Industry
Dr. Enrique Segura Ense Group - A Self-Made Entrepreneur And Executive
DOC-20250806-WA0002._20250806_112011_0000.pdf
20250805_A. Stotz All Weather Strategy - Performance review July 2025.pdf
BsN 7th Sem Course GridNNNNNNNN CCN.pdf
Business model innovation report 2022.pdf
Probability Distribution, binomial distribution, poisson distribution
Amazon (Business Studies) management studies
ICG2025_ICG 6th steering committee 30-8-24.pptx
Laughter Yoga Basic Learning Workshop Manual
The Marketing Journey - Tracey Phillips - Marketing Matters 7-2025.pptx
Reconciliation AND MEMORANDUM RECONCILATION
Dragon_Fruit_Cultivation_in Nepal ppt.pptx
AI-assistance in Knowledge Collection and Curation supporting Safe and Sustai...
unit 1 COST ACCOUNTING AND COST SHEET
kom-180-proposal-for-a-directive-amending-directive-2014-45-eu-and-directive-...
Roadmap Map-digital Banking feature MB,IB,AB
Lecture (1)-Introduction.pptx business communication
unit 2 cost accounting- Tender and Quotation & Reconciliation Statement
Business Management - unit 1 and 2
Katrina Stoneking: Shaking Up the Alcohol Beverage Industry

Intro to Python

  • 1. Intro to Python CSSU Nov/28/2007 By Georgi Petrov & Atanas Dyulgerov
  • 2. Outline What is Python Python Advantages Who uses Python Syntax & Semantics Data Structures Python Standard Library Demo 1 Object Orientation Demo 2
  • 3. What is Python? interpreted, interactive, object-oriented programming language Widely used in the industry Cousin of Tcl, Perl and VB Used in web programming and in standalone applications
  • 4. Python Advantages Elegant syntax Safe Object-oriented Powerful Portable Free
  • 5. Python is simple print &quot;Hello World!&quot; #include <iostream.h> int main() { cout << &quot;Hello World!&quot;; } public class helloWorld { public static void main(String [] args) { System.out.println(&quot;Hello World!&quot;); } } Python C++ Java
  • 6. Python is fun & practical Lack of type declaration Huge library of modules Widespread use in industry Available for all the major platforms (Windows, MacOS, Linux, Unix, BeOS, Java)
  • 7. Who uses Python Google NASA Rackspace Industrial Light & Magic
  • 9. Syntax - Operators Comparison Operators ==, <, >, <=, >= Logical Operators Zero values are treated as “”, 0, None, 0.0, [] and {}
  • 10. Data Structures Base Types integer, float, long integer, octal integer, hexadecimal integer, complex, character string, list, dictionary, tuples, file Collection types sequences & mappings Object system
  • 11. Python Standard Library The greatest strengths of Python Hundreds of modules Examples Syntax: import email email , math , calendar , HTMLParser
  • 12. Object Oriented Mechanism Similar to C++ and Java Supports multiple inheritance Polymorphism No private class members  class Stack: def __init__(self,size): self.data = [None]*size self.size = 0   def push(self,item): self.data[self.size] = item self.size = self.size + 1   def pop(self): self.size = self.size - 1 return self.data[self.size]   def is_empty(self): return self.size == 0   def is_full(self): return self.size == len(self.data)
  • 13. Demo 1 Adjusting Apache to read Python Sample “Hello World” script
  • 14. Object Orientation Defining classes class SomeClass: &quot;Just some class...that's all.&quot; Adding data members and methods class SomeClass &quot;Just some class...that's all.&quot; someNumber = 2131 def someFunction ( self ): return someNumber
  • 15. Object Orientation Self Instantiating myObject = myClass() ‏ Calling and addressing myObject.someFunction() ‏ Deletion del myObject.someNumber
  • 16. Object Orientation Constructors class AnotherClass: def __init__ ( self, anotherArgument ): self.anotherArgument = anotherArgument Single/Multiple Inheritance and Overriding class ParentClass: def print( self ): print “parent” class ChildClass ( ParentClass ): def print( self ): print “child”
  • 17. Demo 2 Brief networking info Sockets SocketServer Framework Ports and Addresses Demo
  • 18. References http://wiki.python.org http://www.python.org/ http://en.wikipedia.org/wiki/Python_(programming_language)
  • 19. Thank You Q & A