Upload
al-sayed-gamal
View
142
Download
0
Tags:
Embed Size (px)
Citation preview
Python 45 Minutes#2
by: @alSayedGamal
Last Hangout
Find python and run your python code/program.
Python basic syntax.
Python expressions, flow control and functions.
Simple script to rate presenters based on raw_input().
In this hangoutData types/ containers to be continued
functions to be continued.
Last hangout script(Re-Read).
Exceptions (Fail fast).
Code organization / Using Modules.
Files and IO
TypesLists, Tuples, Sets, Dictionaries, etc..
Types (Again)Strings
List
Tuple
Dictionary
Set
Collection Transition
FunctionFunctions are FUN.
More(Functions)Definition
Argument Passing
Mutable argument and Default values
Accepting variable arguments
Unpacking argument list
Scope
Sorting Problemvs
Comparison Problem
Sorted(List)
Sorting problem
How python sort ?
Have a better idea ?
Input() vs. Raw_input()
Simple loop
ExceptionsWhat if something went wrong?
Exceptions
Try .. Catch Except
Try:, Except:(, Finally:, Else:)
Fail Fast*
*I’ll be posting martin fowler’s paper on event’s page.
Code organization
Namespace and modules
Namespaces
Import module
Create module
Got a burning question ?
Thank you@alsayed Gamal - GDG Mansoura