160 likes | 480 Views
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
E N D
Python By: Ben Hester
What is Python • Powerful Dynamic Programming Language • Uses Whitespace • Everything Is AObject • Very Portable
History of Python • Created By Guido Van Rossum • An improvement on ABC • Open Source and Community Supported
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++
Control Structures • Supports Nested If- Statements • Does NOT support Switch Statements • Has a different way of doing FOR loops
Default FOR loop • Works similar to a For-Each loop Ex: for w in "Cat": print(w) OUTPUT : C a t
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
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
Subprograms • Every function in Python returns a value • Supports keyword parameters • Allows for nested subprograms
Concurrency • Python supports concurrency • Since Python is interpreted, it can only handle logical concurrency
Error and Event Handling • Extensive Exception handling features • Users can create their own errors through class objects • Python doesn’t have native event handlers
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>.