By: Ben Hester
What is Python Powerful Dynamic Programming Language Uses Whitespace Everything Is A Object 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++
No GOTO
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: for i in range(5, 10): print(i) OUTPUT:
If it looks like a duck….
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 Web. 20 Nov "Learnpython.org." Learn Python. Learnpython.org, n.d. Web. 01 Oct Lott, Steven. "Python - Raising Exceptions." Python - Raising Exceptions. Linuxtopia.org, Web. 20 Nov "Python V3.3.0 Documentation." Overview. Python Software Foundation, n.d. Web. 01 Oct Sebesta, Robert W. Concepts of Programming Languages. Boston: Pearson, 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 Swaroop, CH. A Byte of Python. Vol N.p.: n.p., Print. Vrajitoru, Dana. "C311 Name, Scope, Binding." C311 Name, Scope, Binding. IUSB, n.d. Web. 01 Oct