Python

1,453 views

Published on

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,453
On SlideShare
0
From Embeds
0
Number of Embeds
49
Actions
Shares
0
Downloads
43
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Python

  1. 1. H P M.Gebreel D ev M ix
  2. 2. Minute of silence :(( <ul><li>All copyrights reserved for M. Gebreel(Harry Potter) </li></ul>
  3. 3. Introduction to All copyrights reserved for M. Gebreel(Harry Potter)
  4. 4. Python ??!! what is that ?? All copyrights reserved for M. Gebreel(Harry Potter) All copyrights reserved for M. Gebreel(Harry Potter)
  5. 5. Is this ??!! All copyrights reserved for M. Gebreel(Harry Potter)
  6. 6. I am afraid All copyrights reserved for M. Gebreel(Harry Potter)
  7. 7. No absolutely no :D :D
  8. 8. Simply programming language <ul><li>Scripting Language </li></ul><ul><li>Interpreted </li></ul><ul><li>Object-oriented </li></ul><ul><li>high-level programming language </li></ul>All copyrights reserved for M. Gebreel(Harry Potter)
  9. 9. Python Not named after This man …... Guido van Rossum All copyrights reserved for M. Gebreel(Harry Potter)
  10. 10. All copyrights reserved for M. Gebreel(Harry Potter)
  11. 11. At Anyway <ul><li>Why python ?? </li></ul><ul><li>What will make me learn it ?? </li></ul><ul><li>Or </li></ul><ul><li>Why I love python :D :D ?? </li></ul>All copyrights reserved for M. Gebreel(Harry Potter)
  12. 12. Really love it
  13. 13. <ul><li>Python is powerful... and fast </li></ul><ul><li>#batteries included #ur web server in 3 lines </li></ul><ul><li>Python plays well with others </li></ul><ul><li>#(Jpython)Python for the Java Virtual Machine </li></ul><ul><li># (Ironpython)Python for .NET </li></ul><ul><li>Python runs everywhere </li></ul><ul><li>Python is friendly... and easy to learn </li></ul><ul><li>Python is Open </li></ul>Answer is here All copyrights reserved for M. Gebreel(Harry Potter)
  14. 14. Hello world <ul><ul><ul><li>Python 2.7 </li></ul></ul></ul><ul><ul><ul><ul><ul><li>Print “ hello world” </li></ul></ul></ul></ul></ul><ul><ul><ul><li>Python 3.1 </li></ul></ul></ul><ul><ul><ul><ul><ul><li>Print (“hello world”) </li></ul></ul></ul></ul></ul>All copyrights reserved for M. Gebreel(Harry Potter)
  15. 15. The interactive interpreter <ul><li>All copyrights reserved for M. Gebreel(Harry Potter) </li></ul>
  16. 16. Data types <ul><ul><ul><ul><li>Strings </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Int </li></ul></ul></ul></ul><ul><ul><ul><ul><li>bool </li></ul></ul></ul></ul><ul><ul><ul><ul><li>float (only one real type) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>complex </li></ul></ul></ul></ul><ul><ul><ul><ul><li>files </li></ul></ul></ul></ul>All copyrights reserved for M. Gebreel(Harry Potter)
  17. 17. Attention plz Python speaks now : Do not tire yourself by writing type of the object I will know it by myself ;) All copyrights reserved for M. Gebreel(Harry Potter)
  18. 18. Everything is an Object >>> x = 'hello, world' >>> y = x.upper() >>> y 'HELLO, WORLD!' >>> import calendar >>> cal = calendar >>> print cal.month(2007,10) All copyrights reserved for M. Gebreel(Harry Potter)
  19. 19. Unusual Suspects long — automatic promotion from int if needed >>> x = 1024 >>> x ** 50 32733906078961418700131896968275991521 6642046043064789483291368096133796404674554883270092325904157150886684127560071009217256545885393053328527589376L All copyrights reserved for M. Gebreel(Harry Potter)
  20. 20. Built-in data structures <ul><li>Tuples – Fixed Length </li></ul><ul><li>(1, 2, 3, “Hello”, False) </li></ul><ul><li>Lists </li></ul><ul><li>[1, 2, 4, “Hello”, False] </li></ul><ul><li>Dictionaries </li></ul><ul><li>{42: “The answer”, “key”: “value”} </li></ul><ul><li>Sets </li></ul><ul><li>set([“list”, “of”, “values”]) </li></ul>All copyrights reserved for M. Gebreel(Harry Potter)
  21. 21. Functions <ul><li>Python uses whitespace to determine blocks of </li></ul><ul><li>code (please don't use tabs) </li></ul><ul><li>EX: </li></ul><ul><li>def greet(person): </li></ul><ul><li>if person == “Tim”: </li></ul><ul><li>print “Hello Master” </li></ul><ul><li>else: </li></ul><ul><li>print “Hello %s” % person </li></ul>All copyrights reserved for M. Gebreel(Harry Potter)
  22. 22. Classes class MyClass: &quot;&quot;&quot;This is a docstring.&quot;&quot;&quot; name = &quot;Eric&quot; def say(self): return &quot;My name is %s&quot; % self.name instance = MyClass() print instance.say() All copyrights reserved for M. Gebreel(Harry Potter)
  23. 23. Modules <ul><li>Any python file is considered a module </li></ul><ul><li>Modules are loaded from the PYTHONPATH </li></ul>All copyrights reserved for M. Gebreel(Harry Potter)
  24. 24. Exceptions Also used for flow control – StopIteration Exceptions are classes, and custom exceptions are easy to write to store extra state information EX: try: # Do stuff except Exception, e: # Do something else All copyrights reserved for M. Gebreel(Harry Potter)
  25. 25. Stop !!!! Wanna more ;) Check Out These Links http://docs.python.org/tut/tut.html - The Python Tutorial http://diveintopython.org/index.html - Dive Into Python http://www.garshol.priv.no/download/text/perl.html - Detailed Story of One Perl Hacker's Migration to Python http://www.linuxjournal.com/article/3882 - Eric Raymond's Detailed Story and Praise for Python http://www.pythonmagazine.com - Python Magazine http://www.planetpython.org - Python blog aggregation site All copyrights reserved for M. Gebreel(Harry Potter)
  26. 26. Questions? All copyrights reserved for M. Gebreel(Harry Potter)

×