Download presentation
Presentation is loading. Please wait.
Published byArron Mosley Modified over 9 years ago
1
V2012.13
2
2 Avon High School Tech Club 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
3 Avon High School Tech Club HTML/CSS Class QUESTIONS?
4
4 Avon High School Tech Club Tech Club Executive Committee Next Year: –Election of Officers President Vice President Secretary Treasurer Send me an email with interest
5
5 Avon High School Tech Club Upcoming Schedule Today: Intro to Python May 7th: Intro to Java May 14th: Intro to C# (Guest Speaker) May 21st: Embedded Programming
6
6 Avon High School Tech Club 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
7 Avon High School Tech Club Intro to Python History Brief Overview Installation/Tools Getting Started Examples Resources
8
8 Avon High School Tech Club
9
9 MONTY PYTHON’S FLYING CIRCUS
10
10 Avon High School Tech Club 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
11 Avon High School Tech Club “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
12 Avon High School Tech Club 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
13 Avon High School Tech Club 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
14 Avon High School Tech Club Python Overview - Dictionaries 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 Dictionaries work like associative arrays or hashes and consist of key-value pairs
15
15 Avon High School Tech Club 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. def functionName (parameters):
16
16 Avon High School Tech Club Python Overview - Functions # Function definition is here def printme( 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"); parameter function
17
17 Avon High School Tech Club 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
18 Avon High School Tech Club 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
19 Avon High School Tech Club Getting Started with Python Download Python –http://www.python.org/getit/http://www.python.org/getit/ –Already installed with most Linux distributions
20
20 Avon High School Tech Club Getting Started with Python
21
21 Avon High School Tech Club Running a Python Program 1.Create a file with a.py extension 2.Add some code 3.At a terminal prompt, type: python yourfile.py
22
22 Avon High School Tech Club Resources Official Python Website –http://www.python.org/http://www.python.org/ Python 3 Documentation –http://docs.python.org/3/library/index.htmlhttp://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
23 Avon High School Tech Club Python Tutorial Good Python Tutorial: –Appears to be geared towards Python 2.7 –http://www.tutorialspoint.com/python/
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.