1 / 16

Python

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.

hugh
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. Stephen Jones and Glenn Johnson Python

  2. 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

  3. 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

  4. 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

  5. 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

  6. 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

  7. 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

  8. Interpreted Language • Not converted to machine code • Converted to low level C code • Imported into an Interpreter and run through the interpreter Translation Scheme

  9. 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

  10. 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

  11. 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

  12. Iteration 0 is john. Iteration 1 is pat. Iteration 2 is gary. Iteration 3 is michael.

  13. 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

  14. “Hello, Jack” “Hello, Jill” “Hello, Bob” Answer

  15. Any Questions?

  16. 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

More Related