180 likes | 473 Views
Stephen Jones and Glenn Johnson. Python. Python was created in 1991 by Guido van Rossum. It is a C written language It is used by many major companies . Consistently one of the Ten Most Popular Programming Languages Mentioned in Job Postings. General Information.
E N D
Python was created in 1991 by Guido van Rossum. It is a C written language It is used by many major companies. Consistently one of the Ten Most Popular Programming Languages Mentioned in Job Postings General Information
First developed by Guido van Rossum Originally a pet project to occupy him when he wasn’t at work Name inspired by Monty Python The Development of Python
Guido van Rossum disliked the ABC programming language that many companies were using at a time Designed to be more user-friendly then its predecessor Python is an interpreted language (More on this later in our presentation) More on the Development
Initially targeted the users of the ABC programming language Evolved into targeting those who used C, Java, or other languages similar to them Claim to fame is that its easier to program with and can do so more efficiently Those that want to bridge software from multiple languages (More on that shortly) Target Audience for Python
This programming language uses modules to organize code. Modules are very similar to methods and functions used in C and Java. Modules create namespaces (similar to global and local scopes) where you can store data that can be shared between several programs or several parts of a program Program Organization
Provides Full Dynamic Runtime This allows for quick garbage collection, prevention memory leaks and dangling pointers Eliminates need for header file Typing Errors caught at runtime and corrected Can use raise, try, except, and finally statements to catch exceptions Runtime
Interpreted Language • Not converted to machine code • Converted to low level C code • Imported into an Interpreter and run through the interpreter Translation Scheme
Uses 5 Standard Data Types • Numbers • Strings • Lists • Tuples • Similar to lists but they are enclosed in parenthesis instead of brackets and cannot be updated or redeclared later • Dictionaries • Also uses Boolean; however, Python programmers normally do not consider this a data type as it only holds two values. Data Types
Here is an example of Code: name = raw_input('What is your name?\n') print 'Hi, %s.' % name This two lines of code ask the user for input on their name. It then splits out the name in the following sentence (using “Max” as sample): “Hi, Max.” Sample Code Time
friends = ['john', 'pat', 'gary', 'michael'] for i, name in enumerate(friends): print "iteration {iteration} is {name}".format(iteration=i, name=name) This outputs the following results: More Samples
Iteration 0 is john. Iteration 1 is pat. Iteration 2 is gary. Iteration 3 is michael.
Since the samples are so short, we figured we would show you a third example: def greet(name): print 'Hello', name greet('Jack') greet('Jill') greet('Bob') Yes, 1 More Sample
“Hello, Jack” “Hello, Jill” “Hello, Bob” Answer
http://en.wikipedia.org/wiki/Guido_van_Rossum http://www.tutorialspoint.com/python/python_modules.htm http://python.about.com/od/gettingstarted/ss/whatispython.htm http://penzilla.net/tutorials/python/modules http://pypy.readthedocs.org/en/latest/getting-started-python.html http://mcsp.wartburg.edu/zelle/python/python-first.html http://docs.python.org/reference/executionmodel.html http://wiki.python.org/moin/SimplePrograms References