弄蛇人的程式語言入門

 弄蛇人的程式語言入門

2014/07/15 Workshop @ SITCON Summer Camp 2014, National Chengchi University, Taipei, Taiwan

B3ecf4287d58054135af5d7b4d741021?s=128

Poren Chiang

July 15, 2014
Tweet

Transcript

  1. ශ⣹̍ḑ⁰෇⯅⭚ӧ㉊ RSChiang @ SITCON Summer Camp 2014 H O W

    T O T R A I N Y O U R P Y T H O N
  2. ߐ㡦࿝ዅ RSChiang • 112 ᝖୪㋁ • SITCON / COSCUP ⵈⶦ೸

    • Python ჿࢼ␹ • You can reach me at http://poren.tw
  3. ⁰෇ḑ༦⏯

  4. 民法 158 條 要約定有承諾期限者,⾮非於其期限 內為承諾,失其拘束⼒力。︒。 ⬉≜.send() try: ါⰊ = ⬉≜.wait()

    except TimeoutException: ⬉≜ = null ቒ୕ ⁰෇
  5. Python

  6. Beautiful is better than ugly. Explicit is better than implicit.

    Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts.
  7. #include <iostream> using namespace std; ! int main(int argc, char*

    argv) { cout << “Hi SITCON!”; return 0; } print(“Hi SITCON!”) C++ Python
  8. None
  9. string a = “ݙ”;
 string b = “”; for (int

    i = 1; i <= 5; i++) { b += a; } cout << b; print(“ݙ” * 5) C++ Python
  10. for (int i = 1; i <= 5; i++) {

    cout << “#” << i << “\n”; } for i in range(5): print(“#” + str(i)) C++ Python
  11. captains = [‘Takeshi’, ‘ୖ⭘’, ‘EAT’, ‘┧㕕’] for captain in captains:

    print(‘Captain ’ + captain) print(len(captains))
  12. speakers = [‘Allen’, ‘Bob’, ‘RS’, ‘⒀㐷’] for i, speaker in

    enumerate(speakers): print(‘#{0} - {1}’.format(i, speaker)) print(len(captains))
  13. Live Examples

  14. reduce( lambda a, b: a or b, [ x %

    i == 0 for i in range( 2, int(x ** 0.5 + 1) ) ] )
  15. Thanks!