Po Chun, Lu
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee
  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- GA: UA-143018435-1 --- # Coding-X - Python - Response ## 內容面 針對幾個問題回應,雖然又過了一週這些問題現在應該懂了(不懂就問隔壁?),但之後如果要教高中生可以補充一下 #### Python 能做什麼? - 簡單說法補充 * 資料科學 (強項,推薦使用) * 資料挖掘、分析、視覺化 * 科學運算 * 機器學習 * 伺服器端 (可用,也很常用) * Web 網頁後端 * APP 後端 * GUI (有辦法做到,但不建議) * Mobile APP * Desktop APP * 其他 * Fintech 相關 (可用) * Blockchain 相關 (可用) * Embeded system (可用,但不建議) * Game (可用,但不建議) - 可用但不建議 -> 因為有其他語言比較適合 - 完整說法 - [Where is Python mostly used?](https://www.quora.com/Where-is-Python-mostly-used) - [What exactly can you do with Python? Here are Python's 3 main applications.](https://www.freecodecamp.org/news/what-can-you-do-with-python-the-3-main-applications-518db9a68a78/) > YouTube, DropBox, Google, Quora and even Netflix use Python. Also it is the second most used language in the world according to Github. #### 使用AWS,本地端執行的方法,差異不太清楚 在 AWS 執行程式 -> 透過網頁在別人電腦上跑程式 在 本地端執行(你的電腦) -> 在你的電腦跑程式 #### 不懂 for 迴圈 > 迴圈 = 不斷重複循環執行一段 code > 想到 While 就要想到"條件",要提供條件,條件達成就會不斷重複while裡面的 code,可複習奇異博士結局前 30min > 想到 For 就要想到"範圍",要提供範圍(list, tuple, dict等可迭代(iterable)的東西),會在這範圍內重複,同時依序取出範圍內的內容 ``` numbers = [1, 3, 5, 7, 9] for number in numbers: # 對於 每一個 在 numbers 的東西,依序命名為 number print(number) # 執行以下程式碼 # 印出 1 3 ... ``` #### Lesson04 p56 t('world!') 不懂 t('world!') 是執行 t 這個函式,再把 world 當參數丟進去 這種作法初學者不會那麼快用到(應該是不需要教高中生),不過也再解釋一下 ![](https://i.imgur.com/MriKzYW.png) 這是Closure(閉包)的用法,可參考 [聊聊 Python Closure](https://medium.com/@dboyliao/%E8%81%8A%E8%81%8A-python-closure-ebd63ff0146f) #### list, dict ``` # list -> 複數東西,很多性質一樣的東西的組合 # 使用上後面加個[]裡面放編號就可取出數值 anime = ['K-ON!', 'The niece of time'] years = [2003, 2005, 2006, 2007] print(anime[0]) # 印出 K-ON! # dict -> "字典" 顧名思義,可以用關鍵字取出對應的數值 exam = { 'math': 90, 'English': 80 } print(exam['math']) # 印出這次考試數學的分數 90 ``` #### 爬蟲方法,API的概念 時間因素沒辦法教,網路上蠻多資源的,只要找 "python 爬蟲" 就有 或者看[去年的](https://nbviewer.jupyter.org/format/slides/github/x-village/python-course/blob/master/Lesson08-Web%20Crawler/Lesson09-Crawler%20%28%26%20API%29.ipynb#/1) #### 縮排要按四次空格 不不用按四次空白鍵, 鍵盤左上角的 `tab 按鍵` 可以設定成輸出 `空白字元` 或是 `tab字元`, 就好像你`同樣的按鍵`用`中文輸入`就跑出`注音`,用`英文輸入`就跑出`字母`一樣 python 建議將 “tab 按鍵” 統一設定輸出"空白字元"(4個空白) 通常clou9 跟 vscode 都預設按下 tab 是輸出 4個空白,可以看編輯器右下角有沒有設定對 cloud9 有 space: 4 ![](https://i.imgur.com/0d6M1Dl.png) vscode 有個空格 4 ![](https://i.imgur.com/7GujJlG.png) ## 教材面 ### 希望有 ppt 版本能下載做筆記 - 目前有提供 pdf 版本可以先看,ppt 版本因為轉換過於困難暫不提供。 - 在先前的貼文有放 pdf ,權限已開啟感謝提醒 ![](https://i.imgur.com/qJuGnYe.png) ### 可以提供更多 optional 作業 - 這次 python 課受眾原則上還是以初學者為主,如果認為題目不夠,之後可以到以下兩個網站練習更多題目 - [LeetCode](https://leetcode.com/problemset/algorithms/) - [Codewar](https://www.codewars.com/) 要先解出一題才能註冊 - 或是嘗試寫 "人輸入幾A幾B, 電腦猜數字" 的 1A1B ### 更好的寫法 - Python [pep8規範](https://www.python.org/dev/peps/pep-0008/) - 可參考 [code convention](https://nbviewer.jupyter.org/format/slides/github/x-village/python-course/blob/master/Lesson05-Exception%20Handling/Lesson05-Coding%20Convention.ipynb#/) 把 `pylint` 裝起來,他會檢查寫法是否符合規範 - 其他跟寫作文一樣多寫多看才知道更好的寫法 - 閱讀其他 Refactor(重構), code convention 相關文章 - 可參考[编程的智慧](http://www.yinwang.org/blog-cn/2015/11/21/programming-philosophy) - [Clean Code](https://www.books.com.tw/products/0010579897) - 不易懂,網路上很多別人心得,可先看能不能看懂別人寫的心得 - Python 專用 - python 相關書籍,了解 python 特性 - [深入淺出 Python](https://www.tenlong.com.tw/products/9789864769902) 初學者友善 - [think python](https://www.tenlong.com.tw/products/9789864761357?list_name=srh) 初學者友善 - [英文線上版](http://greenteapress.com/thinkpython2/html/index.html) - 相關文章或演講 - [James Powell: So you want to be a Python expert? | PyData Seattle 2017](https://www.youtube.com/watch?v=cKPlPJyQrt4) - [PyCon TW 2018 - A Python Engineer Under Giant Umbrella (巨大保護傘下的 Python 碼農辛酸史)](https://www.slideshare.net/ssuser2cbb78/pycon-tw-2018-a-python-engineer-under-giant-umbrella-python) - [如何高效學python]( https://juejin.im/post/5b34a1d26fb9a00e4f74d981) 其他學習資源就像第一天下午的,可以參考[這份簡報](https://docs.google.com/presentation/d/15szHjI0Pt5KoE9c1RYrPDuKiE8jm3nm_a6AVZBisUiE/edit#slide=id.g5d05c32d6d_0_1139)看看 如果還有其他 python 問題可以 email oceanus11034@gmail.com 或直接用 [messenger](https://www.messenger.com/t/100002402896931) (假日比較有空回)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully