30

Python novice to ninja

Embed Size (px)

Citation preview

Page 1: Python novice to ninja
Page 2: Python novice to ninja

PYTHON FROM NOVICE TO NINJA.WORKSHOP BY @ALSAYEDGAMAL

Page 3: Python novice to ninja

WARNING: BEGINNERS ONLY SESSIONWELL, IT’S OK TO JOIN IF YOU HAVE NO PYTHON EXPERIENCE.

Page 4: Python novice to ninja

AGENDA

• Motivation.

• Python essentials.*

• Basic application development.*

• Tips and tricks.

• Your python track.

*= HANDS ON

Page 5: Python novice to ninja

MOTIVATIONWHY PYTHON ?

Page 6: Python novice to ninja

WHY PYTHON?

• It’s Open source.

• Cross platform.

• Easy to learn.

• No boiler plates.

• Dynamic(to be explained in code).

• Community.?

Page 7: Python novice to ninja

OPEN SOURCEOPEN SOURCE == FREEDOM.

Page 8: Python novice to ninja

CROSS PLATFORMWRITE ONCE, RUN EVERYWHERE.

Page 9: Python novice to ninja

EASY TO LEARNIT TAKES > 10 SECONDS TO WRITE YOUR HELLO, WORLD.

Page 10: Python novice to ninja

SYSTEM.OUT.PRINT(“HELLO,WORLD”);IT TAKES 1 LINE TO YOUR “HELLO, WORLD”

Page 11: Python novice to ninja

FROM 29TH TO 8TH IN < 7 YEARS*IT’S 8TH TOO IN 2013.

*TOIBE.COM | TIOBE PROGRAMMING COMMUNITY INDEX FOR NOVEMBER 2013

Page 12: Python novice to ninja

FROM 29TH TO 8TH IN < 7 YEARS*IT’S 8TH TOO IN 2013.

*TOIBE.COM | TIOBE PROGRAMMING COMMUNITY INDEX FOR NOVEMBER 2013

Page 13: Python novice to ninja

–Steve Jobs

“Innovation distinguishes between a leader and a follower.”

Page 14: Python novice to ninja

PYTHON ESSENTIALS

• Scripting nature.

• Basic data types.

• Operators.

• Flow control.

• Functions are fun.

• Modules.

• OOP.

Page 15: Python novice to ninja

EXPRESSION IN PYTHON.

EXPRESSIONvariable = 3 + 2

Page 16: Python novice to ninja

EXPRESSION IN PYTHON.

EXPRESSIONvariable = 3 + 2

OPERATORS

OPERANDS

Page 17: Python novice to ninja

EXPRESSION IN PYTHON.

EXPRESSIONvariable = 3 + 2

OPERATORS

OPERANDSVariablesx,name, __len__

Data5, “hello”,

[1,2,3]

Page 18: Python novice to ninja

EXPRESSION IN PYTHON.

EXPRESSIONvariable = 3 + 2

OPERATORS

OPERANDS

+ * = / %[] () > = & != |

Variablesx,name, __len__

Data5, “hello”,

[1,2,3]

Page 19: Python novice to ninja

PYTHON BLOCKS

def foo(x,y):

function body

class class_name(parent):

class definition

if condition:

If block

for item in structure:

for block

LoopBranching

Class definitionFunction definition

Page 20: Python novice to ninja

GETTING YOUR HANDS DIRTYTIME TO EXPLAIN IN CODE.

Page 21: Python novice to ninja

BEFORE WE START

• If you are linux or unix based you are good to go.

• Else If you are on windows (I hope not) download and install

• sublime text editor

• python runtime

• Our code will be perfect for Python 2.x and may be 3.x.

Page 22: Python novice to ninja
Page 23: Python novice to ninja

SORTED?

Page 24: Python novice to ninja

MEDIA.PY

P1: Tawfik Okasha

P2: Amr Adib

Page 25: Python novice to ninja

SCRIPT HIGHLIGHTS.

• Basic expression (variable assignment).

• User input and output.

• Function definition / passing function as variable.

• List data-type.

• Basic sorting.

Page 26: Python novice to ninja
Page 27: Python novice to ninja

NEXT: SHAPING YOUR EXPERIENCESYSTEM ADMIN, WEB, DESKTOP, NETWORK, GAME DEVELOPMENT,…

Page 28: Python novice to ninja
Page 29: Python novice to ninja

QUESTIONS?

Page 30: Python novice to ninja

THANKS