Upgrade to Pro — share decks privately, control downloads, hide ads and more …

HitchHiker's guide to python

HitchHiker's guide to python

Introduction to python programming

smit thakkar

January 27, 2017
Tweet

More Decks by smit thakkar

Other Decks in Programming

Transcript

  1. About me #SMIT • Lead Software Developer at LendCypher •

    Former Technical Co-Founder at Punchit.io • Author of open source Flask Extensions : Flask-NSFW and Flask-ReqParse • Technology Stack: Python, Flask, MongoDB, PostgresQL and Angular2 • Hackathon Lover • Email : [email protected] • Github : github.com/smitthakkar96 • Facebook : https://www.facebook.com/geekysmit
  2. About me #PARTH • I work for Lendcypher as a

    UX Designer. • Former Co-Founder at Inktwig. • Weapons: Html, CSS, JS, Angular2, Corel Painter, photoshop, illustrator, after effects and blender • Hackathon Lover & Hardcore Gamer • [email protected] • github.com/parth181195 • instagram.com/parth_jansari/
  3. Agenda • Our Hacker backpack • Setting up development environment

    for python • History of Python • Features of Python? • Who Uses Python • Kickstarting Python Programming ◦ Variables, Datatypes and operators ◦ Control flow structures and looping ◦ Exception handling ◦ Data Structures ◦ Python PreBuilt Modules • Q/A
  4. • In 1980 founded by Guido Van Rossum • The

    name Python belongs to popular T.V. show “Monty Python's Flying Circus” not the raptile. • Popular versions are Python 2 and Python 3. • Designed for Students who are learning programming as their first language • MIT has enrolled Python as their first language. History of Python
  5. Features of Python • Interpreted language • Easy to learn

    • Code is readable • Beginner friendly community • Open Source and Community driven • Crossplatform • Large collection of library packages available
  6. Introduction to Interpreter • Invoking Interpreter ◦ ‘ipython’ # Interactive

    Mode ◦ ‘python program.py’ # Script Mode • Prompts ◦ ‘>>>’ # Primary Prompt ◦ ‘...’ # Secondary Prompt • Using Python as a Desk Calculator ◦ +, -, *, /, **, //, % # Operators • NamError
  7. Variables and Datatypes in Python • Ducked Typed Language •

    type() • dir() • Comments ‘#’ • Overriding Variable
  8. Strings - I • Immutable type • ‘Single Quoted String’

    and “Double Quoted String” are same! • Using ‘\’ for escaping characters • Multiline strings ◦ String multiplication (*) • Concatenation • len()
  9. String - II | P | Y | T |

    H | O | N | ----------------------------- 0 1 2 3 4 5 -6 -5 -4 -3 -2 -1 • Indexing (Python supports Negative Indexing!)
  10. Array • An Array is fixed size sequential collection of

    elements • An Array consists elements of same data type. • An Array is a mutable data type • Array Functions ◦ tofile ◦ count ◦ tostring ◦ pop ◦ insert ◦ index
  11. Lists • Lists in python are mutable data types consisting

    heterogeneous mixture of elements with different datatypes. • Lists supports negative indexing and slicing • List functions ◦ tofile ◦ count ◦ tostring ◦ pop ◦ insert ◦ index
  12. Dictionary • Mutable type • Keys are unique • Immutable

    type can be key • Example ◦ user = {‘id’: 1, ‘name’: ‘Bob’, ‘email’: ‘[email protected]’} • d.keys() • d.values() • d.items() • enumerate()
  13. Q/A