1 / 14

Python

Python. By: Ben Hester. What is Python. Powerful Dynamic Programming L anguage Uses Whitespace Everything Is A O bject Very Portable. History of Python. Created By Guido Van Rossum An improvement on ABC Open Source and Community Supported. Basics. Case Sensitive

kelvin
Télécharger la présentation

Python

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Python By: Ben Hester

  2. What is Python • Powerful Dynamic Programming Language • Uses Whitespace • Everything Is AObject • Very Portable

  3. History of Python • Created By Guido Van Rossum • An improvement on ABC • Open Source and Community Supported

  4. Basics • Case Sensitive • Unlimited Integers • Arrays can contain elements of different types • Arrays can be broken into slices • Can be expanded with C or C++

  5. No GOTO

  6. Control Structures • Supports Nested If- Statements • Does NOT support Switch Statements • Has a different way of doing FOR loops

  7. Default FOR loop • Works similar to a For-Each loop Ex: for w in "Cat": print(w) OUTPUT : C a t

  8. FOR Loops Java Python for(int i = 5; i < 10; i++) System.out.printf("%d\n", i); OUTPUT: 5 6 7 8 9 for i in range(5, 10): print(i) OUTPUT: 5 6 7 8 9

  9. If it looks like a duck….

  10. Duck Typing • Python is a Dynamically Typed Language • Duck Typing is a subset of dynamic typing • In Python, methods don’t care what is passed as long as it works

  11. Subprograms • Every function in Python returns a value • Supports keyword parameters • Allows for nested subprograms

  12. Concurrency • Python supports concurrency • Since Python is interpreted, it can only handle logical concurrency

  13. Error and Event Handling • Extensive Exception handling features • Users can create their own errors through class objects • Python doesn’t have native event handlers

  14. Sources • Beazley, David. "An Introduction to Python Concurrency." An Introduction to Python Concurrency. USENIX Technical Conference, June 2009. Web. 20 Nov. 2012. <http://www.slideshare.net/dabeaz/an-introduction-to-python-concurrency>. • "Learnpython.org." Learn Python. Learnpython.org, n.d. Web. 01 Oct. 2012. <http://www.learnpython.org/>. • Lott, Steven. "Python - Raising Exceptions." Python - Raising Exceptions. Linuxtopia.org, 2002. Web. 20 Nov. 2012. <http://www.linuxtopia.org/online_books/programming_books/python_programming/python_ch17s03.html>. • "Python V3.3.0 Documentation." Overview. Python Software Foundation, n.d. Web. 01 Oct. 2012. <http://docs.python.org/py3k/>. • Sebesta, Robert W. Concepts of Programming Languages. Boston: Pearson, 2012. Print. • Shaw, Zed A. "Learn Python The Hard Way, 2nd Edition." Learn Python The Hard Way, 2nd Edition — Learn Python The Hard Way, 2nd Edition. N.p., n.d. Web. 01 Oct. 2012. <http://learnpythonthehardway.org/book/>. • Swaroop, CH. A Byte of Python. Vol. 1.9. N.p.: n.p., 2008. Print. • Vrajitoru, Dana. "C311 Name, Scope, Binding." C311 Name, Scope, Binding. IUSB, n.d. Web. 01 Oct. 2012. <http://www.cs.iusb.edu/~danav/teach/c311/c311_3_scope.html>.

More Related