python programming language

12
Python Programming Language by Vasu Chetty

Upload: chanel

Post on 24-Feb-2016

67 views

Category:

Documents


2 download

DESCRIPTION

Python Programming Language. b y Vasu Chetty. Origins of Python. Created by: Guido van Rossum , a Dutch Programmer Created during: Christmas Break, 1989 Created because: Guido had some free time and an idea for an interpreter Named after: . Python Through the Ages. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Python Programming Language

Python Programming Language

by Vasu Chetty

Page 2: Python Programming Language

Origins of Python

• Created by: Guido van Rossum, a Dutch Programmer

• Created during: Christmas Break, 1989• Created because: Guido had some free time

and an idea for an interpreter• Named after:

Page 3: Python Programming Language

Python Through the Ages

• Version 0: Inheritance, exception handling, functions, and core data types of list, str and dict

• Version 1: Lambda, reduce(), filter(), and map()• Version 2: Garbage collection and generators• Version 3: Unification of str/unicode types,

statements switched to function calls, and instances of list replaced by views and iterators

Page 4: Python Programming Language

Why Python?

• Freely available• Well-documented• Fosters rapid development• Very high-level object-oriented language• Integration facilities for mixed-language

development

Page 5: Python Programming Language

Who uses Python?

• Google (e.g. code.google.com was written in Python)

• New York Stock Exchange (web-based transaction system)

• YouTube• NASA• Other common uses include: RSS readers, CGI

applications, generating and analyzing logs, and creating HTML calendars

Page 6: Python Programming Language

Python Programming Paradigms(say that 10 times fast)

• Object-oriented• Iterative (generators)• Imperative (follows sequential steps)• Functional (lambda calculus)

Page 7: Python Programming Language

Common Data Types and Elements

• Numbers: integer, floating point, complex• Other: boolean, none, string, tuple, list, dictionary, set• Conditionals: if, else, elif• Loops: while, for• Supports: nested loops, functioncalls from other functions, stringconcatenation, combined boolean, string, or integer in conditional with“and” or “or”

Page 8: Python Programming Language

Functions in Python

• Functions are essentially objects, making them very flexible

• Functions are considered as first class, so they can be passed to and from other functions

• Return values need not be set, return none statements are implicitly built in

• Functions can be nested within other functions

Page 9: Python Programming Language

Pass-by-value or Pass-by-reference

• All parameters in Python are pass-by-reference, but some appear to act as pass-by-value because of the difference between mutable and immutable objects

• String, tuples and numbers are immutable, altering them will create a new instance

• Lists and dictionaries are mutable, altering them will also change the original object

Page 10: Python Programming Language

Type Checking: Dynamic and Strong

• Python has dynamic type checking, which means all types are resolved at run-time rather than at compile time

• Python uses strong type checking, ensuring type errors are thrown for mismatches in type

• As of version 3, Python no longer supports type coercion

• Static type inference is not possible in Python

Page 11: Python Programming Language

Object-orientedness

• Python supports multiple inheritance• Python utilizes static variable and static

method inheritance• Super(), in version 3 of

Python, is invoked dynamically and calls thesuperclass method of the same name

Page 12: Python Programming Language

Conclusion

• Python is an easy-to-use, robust programming language that is freely available

• Python’s objects and functions are very versatile

• Python is a very high-level object-oriented language

• Python is awesome!