1 / 23

V2012.13

V2012.13. Agenda. Old Business Delete Files New Business Week 18 Topics: Intro to HTML/CSS: Questions? Summer Work Letter to Hyland Upcoming Schedule Group E xecutive Committee Introduction to Programming … Python. HTML/CSS Class. QUESTIONS?. Tech Club Executive Committee.

kort
Télécharger la présentation

V2012.13

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

  2. Agenda • Old Business • Delete Files • New Business • Week 18 Topics: • Intro to HTML/CSS: Questions? • Summer Work • Letter to Hyland • Upcoming Schedule • Group Executive Committee • Introduction to Programming … Python

  3. HTML/CSS Class QUESTIONS?

  4. Tech Club Executive Committee • Next Year: • Election of Officers • President • Vice President • Secretary • Treasurer • Send me an email with interest

  5. Upcoming Schedule • Today: Intro to Python • May 7th: Intro to Java • May 14th: Intro to C# (Guest Speaker) • May 21st: Embedded Programming

  6. Intro to Programming … Reset! • Language Targets • Python, Java, C# • Our Approach: • Install Tools (if needed) • Start with basic examples (for each language) • Walk step-by-step through each example • Explain each line of code • Explain concepts • Define Terms • Challenges (for each language)

  7. Intro to Python • History • Brief Overview • Installation/Tools • Getting Started • Examples • Resources

  8. NOT NAMED AFTER THE SNAKE …

  9. … NAMED FOR THESE GUYS! MONTY PYTHON’S FLYING CIRCUS

  10. Python Overview • Over 20 years old • General-purpose, high-level language • Used in math, science, web development, etc. • Emphasizes code readability and simplicity • Dynamic typing • Runs on multiple platforms

  11. “Batteries Included Language” • Python includes a “Standard Library” • A collection of modules to make some set of tasks simpler • Very extensive, offering a wide range of facilities

  12. Python Overview - Strings str = 'Hello World!' print str# Prints complete string print str[0]# Prints first character of the string print str[2:5]# Prints characters starting from 3rd to 6th print str[2:] # Prints string starting from 3rd character print str* 2# Prints string two times print str+ "TEST" # Prints concatenated string

  13. Python Overview - Lists list = [ 'abcd', 786 , 2.23, 'john', 70.2 ] tinylist= [123, 'john'] print list # Prints complete list print list[0]# Prints first element of the list print list[1:3]# Prints elements starting from 2nd to 4th print list[2:]# Prints elements starting from 3rd element print tinylist* 2# Prints list two times print list + tinylist# Prints concatenated lists

  14. Python Overview - Dictionaries • Dictionaries work like associative arrays or hashes and consist of key-value pairs dict= {'name': 'john','code':6734, 'dept': 'sales'} print dict['one'] # Prints value for 'one' key print dict[2] # Prints value for 2 key print tinydict# Prints complete dictionary print tinydict.keys() # Prints all the keys print tinydict.values() # Prints all the values

  15. Python Overview - Functions • Defining a function only gives it a name, specifies the parameters that are to be included in the function, and structures the blocks of code. • Once the basic structure of a function is finalized, you can execute it by calling it from another function or directly from the Python prompt. deffunctionName (parameters):

  16. Python Overview - Functions # Function definition is here defprintme( str ): "This prints a passed string into this function" print str; return; # Now you can call printme function printme("I'm first call to user defined function!"); printme("Again second call to the same function"); function parameter

  17. Python Overview - Modules • A module allows you to logically organize your Python code. Grouping related code into a module makes the code easier to understand and use. • Simply, a module is a file consisting of Python code. A module can define functions, classes, and variables. A module can also include runnable code.

  18. Python Overview - Modules • You can use any Python source file as a module by executing an import statement in some other Python source file. import has the following syntax: import modulename

  19. Getting Started with Python • Download Python • http://www.python.org/getit/ • Already installed with most Linux distributions

  20. Getting Started with Python

  21. Running a Python Program • Create a file with a .pyextension • Add some code • At a terminal prompt, type: python yourfile.py

  22. Resources • Official Python Website • http://www.python.org/ • Python 3 Documentation • http://docs.python.org/3/library/index.html • Learning • CodeAcademy • http://www.codecademy.com/tracks/python • LearningPython.org • http://www.learnpython.org/ • After Hours Programming Python • http://www.afterhoursprogramming.com/tutorial/Python/Overview

  23. Python Tutorial • Good Python Tutorial: • Appears to be geared towards Python 2.7 • http://www.tutorialspoint.com/python/

More Related