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

An Introduction to Python

Avatar for D. Yu D. Yu
February 22, 2014

An Introduction to Python

A short peek into what makes Python great and a somewhat mindless ran about my favorite feature. HINT: It's not the whitespace.

First presented in PyCon PH 2014 - Feb 22, 2014.

Avatar for D. Yu

D. Yu

February 22, 2014

More Decks by D. Yu

Other Decks in Technology

Transcript

  1. Me! • engageSPARK • PizzaPy.PH • not as smart as

    my name sounds like • that’s not me in the picture
  2. “I thought this was going to be a technical talk.”

    • I don’t have the skills to teach you Python in 30 minutes. • There’s a workshop for beginners tomorrow. • There are better resources on the Internet.
  3. “There are better resources on the Internet.” Arranged in alphabetical

    order to avoid arguments: • Codecademy’s Python Track • Learn Python the Hard Way • The Official Docs
  4. In Python: def breakfast(): if coffee: dyu.drink(coffee) dyu.eat(anything) else: dyu.buy_coffee()

    Whitespace matters... In languages that use braces: void breakfast() { // intentionally made // to look bad if (coffee > 0) { dyu->drink(coffee); dyu->eat(anything); } else dyu->buy_coffee(); }
  5. In Python: def breakfast(): if coffee: dyu.drink(coffee) dyu.eat(anything) else: dyu.buy_coffee()

    K&R? In languages that use braces: void breakfast() { // intentionally made // to look bad if (coffee > 0) { dyu->drink(coffee); dyu->eat(anything); } else dyu->buy_coffee(); }
  6. In Python: def breakfast(): if coffee: dyu.drink(coffee) dyu.eat(anything) else: dyu.buy_coffee()

    Egyptian? In languages that use braces: void breakfast() { // intentionally made // to look bad if (coffee > 0) { dyu->drink(coffee); dyu->eat(anything); } else dyu->buy_coffee(); }
  7. In Python: def breakfast(): if coffee: dyu.drink(coffee) dyu.eat(anything) else: dyu.buy_coffee()

    Single line special case? In languages that use braces: void breakfast() { // intentionally made // to look bad if (coffee > 0) { dyu->drink(coffee); dyu->eat(anything); } else dyu->buy_coffee(); }
  8. In Python: def breakfast(): if coffee: dyu.drink(coffee) dyu.eat(anything) else: dyu.buy_coffee()

    To be fair... In languages that use braces: void breakfast() { // intentionally made // to look bad if (coffee > 0) { dyu->drink(coffee); dyu->eat(anything); } else dyu->buy_coffee(); }
  9. NO

  10. NO

  11. NO

  12. We have very strong women in the community: What our

    women are presenting: • data analytics • image processing • NLP What our men are presenting: • warm and fuzzy talks