15
Python 45 Minutes #2 by: @alSayedGamal

Python45 2

Embed Size (px)

Citation preview

Page 1: Python45 2

Python 45 Minutes#2

by: @alSayedGamal

Page 2: Python45 2

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

Page 3: Python45 2

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

Page 4: Python45 2

TypesLists, Tuples, Sets, Dictionaries, etc..

Page 5: Python45 2

Types (Again)Strings

List

Tuple

Dictionary

Set

Collection Transition

Page 6: Python45 2

FunctionFunctions are FUN.

Page 7: Python45 2

More(Functions)Definition

Argument Passing

Mutable argument and Default values

Accepting variable arguments

Unpacking argument list

Scope

Page 8: Python45 2

Sorting Problemvs

Comparison Problem

Page 9: Python45 2

Sorted(List)

Sorting problem

How python sort ?

Have a better idea ?

Input() vs. Raw_input()

Simple loop

Page 10: Python45 2

ExceptionsWhat if something went wrong?

Page 11: Python45 2

Exceptions

Try .. Catch Except

Try:, Except:(, Finally:, Else:)

Fail Fast*

*I’ll be posting martin fowler’s paper on event’s page.

Page 12: Python45 2

Code organization

Page 13: Python45 2

Namespace and modules

Namespaces

Import module

Create module

Page 14: Python45 2

Got a burning question ?

Page 15: Python45 2

Thank you@alsayed Gamal - GDG Mansoura