程式設計第六組
      • 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
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • 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
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy 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
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 第十一週筆記 ### 考試題目檢討_第一部分 第一題 ``` x,y=67,80 x,y,z=1,2,3 print(x,y,z) ``` 答案 ![](https://i.imgur.com/sjSXkml.png) > 因為第一行的x,y會被第二行的覆蓋 --- 第二題 ``` a="2" b="2" print(a+b) ``` 答案 ![](https://i.imgur.com/FoFPKsx.png) --- 第三題 ``` y = 10 x = y += 2 print(x) ``` 答案:**Error** --- 第四題 ``` for item in (1,2,3,4,5): print(item) print(item) print(item) ``` 答案 ![](https://i.imgur.com/JkhNUlo.png) --- 第五題 ``` bag = {"Doran's Blade","Doran's Blade","Doran's Blade", "Berserker's Greaves","Caulfield's Warhammer"} print(bag) ``` 答案 ![](https://i.imgur.com/ODoGox9.png) > 因為bag是一個set,set會過濾重複的字串,只留下一個。 --- 第六題 ``` total = 0 n=10 for i in range(n+1): total += i print(total) ``` 答案 ![](https://i.imgur.com/Hlsvv3x.png) > 從1開始累加至10 --- 第七題 ``` list = ["A","B","C","D","E","F",] print(list[:-1]) print(list[2:4]) ``` 答案 ![](https://i.imgur.com/R19Q2Ew.png) > [:-1]=由第0個~倒數第1個,但不包括倒數第1個 > [2:4]=由第2個~第4個,但不包含第4個 --- 第八題 ``` data = pd.read_excel("/content/drive/My Drive/aprilNetIncome.csv") print(data["material_expense"]) ``` ``` 意義:讀取/content/drive/My Drive路徑底下名為的aprilNetIncome的csv檔,印出之中的material_expense欄位 ``` --- ### 第二部分 第一題 ``` bubble = [18,9,13,6] for i in range(len(bubble)): for j in range(len(bubble)-1): if bubble[j] > bubble[j+1]: temp = bubble[j] bubble[j] = bubble[j+1] bubble[j+1] = temp print(bubble) print("----") print(bubble) ``` 答案 ![](https://i.imgur.com/tPXxcvA.png) --- 第二題 > 列印出九九乘法表 ``` list = [1,2,3,4,5,6,7,8,9] for i in list: for j in list: print(i,"x",j,"=",i*j) ``` --- 第三題 > 找出比15大的數字有幾個 ``` list = [1,3,7,13,15,16,22,29] count = 0 for i in range(len(list)): if ( 15 > list[i] ): count = count + 1 print(count) ``` 答案 ![](https://i.imgur.com/gBOz3MK.png) --- 第四題 > 將下列三種水果兩兩一組進行排列,共有幾種排法 ``` list = ['蘋果', '香蕉', '葡萄'] for i in range(len(list)): print(list[i]) if (i == len(list)-1): print(list[0] + list[len(list)-1]) else : print(list[i] + list[i+1]) ``` 答案 ![](https://i.imgur.com/MSD6pB0.png) --- 第五題 1. 列印出以下表格 ![](https://i.imgur.com/dsdHHUy.png) 答案 ``` import pandas as pd grades = { "姓名": ["小明", "小美", "小花", "小華","小文"], "國文": [71,80,58,59,44], "數學": [92,15,66,70,68], "英文": [68,99,63,72,87] } df = pd.DataFrame(grades) print(df) ``` 2. 印出第一位和第三位學生姓名和其國文、數學成績 ``` print(df.loc[[0,2],["姓名","國文","數學"]]) ``` ![](https://i.imgur.com/jtAhr7K.png) 3. 將小華的英文成績改成77分 ``` df.at[3,"英文"] = 77 print(df.loc[[3],["姓名","英文"]]) ``` ![](https://i.imgur.com/kA2UXC7.png) 4. 找出過文成績不及格的同學 ``` print(df[df["國文"] < 60]) ``` ![](https://i.imgur.com/3FSmyUd.png) --- ## 期末小組專題討論 ### 主題挑選: 政府資料開放平臺:https://data.gov.tw 1. 動物園門票收入及入園人數統計:https://data.gov.tw/dataset/152244 2. 兒童新樂園園區營運時間及門票資訊:https://data.gov.tw/dataset/128427 3. 來臺旅客在臺北市之消費及動向:https://data.gov.tw/dataset/145620 4. 南投縣十大熱銷農產品:https://data.gov.tw/dataset/95030 5. 活產新生兒之出生體重:https://data.gov.tw/dataset/152369 6. 桃園市政府110年度人事機構終身學習時數統計表:https://data.gov.tw/dataset/149282 ### 主題討論結果: 南投縣十大熱銷農產品 ### 研究背景 身處於南投讀書的我們,其實對於南投的產品非常陌生,為了更加了解在地的相關知識,我們決定透過這份研究,深入的探討南投在地的產品,而我們會選擇將研究重心放在「農產品」是因為南投的農產品種類豐富,屬於南投名產、伴手禮,希望透過此份研究統計出增加南投經濟的重要產品。 ### 研究問題 本研究希望探討南投十大熱銷農產品的羅倫茲曲線及吉尼係數。 ### 資料來源 我們從[政府公開資料平台上](https://data.gov.tw/dataset/95030)取得南投十大熱銷農產品的相關資料,加以進行分析。 ### 資料清理 商品介紹欄位沒有用到,要刪除 日期區間欄位沒有用到,要刪除 商家名稱欄位沒有用到,要刪除 ## 開會紀錄 * 開會時間:4/27(三) 21:00~23:00 * 討論內容: 1. 考試題目檢討 2. 期末小組專題題目討論 3. 討論下次開會時間 * 開會截圖: ![](https://i.imgur.com/Ls9cvQQ.jpg)

    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