中興大學資訊社
      • 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
    • 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 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
    --- title: Before the class - Python 教學 description: 中興大學資訊研究社1101學期程式分享會主題社課 tags: Python --- # 本篇網址:https://reurl.cc/Kr4zyM | 簽到表單&課後回饋單(因應防疫需簽到) | 入社表單 | | --- | --- | | [![](https://i.imgur.com/o5kwHyy.png =260x)](https://forms.gle/bghmKYxjc9v7m9WE8) | [![](https://i.imgur.com/tChibID.jpg =260x)](https://reurl.cc/q1keqn) | --- # Before the class > [name=Hui][time= 110,10,13] --- ## 前言 ### 預期收穫 日常如文書處理,興趣如網頁爬蟲,更有人工智慧、金融分析等等 以下是我們曾經或預計會上的社課 [colab 連結](https://colab.research.google.com/) [爬蟲教學](https://hackmd.io/B7mFSoaRRJmKr6nWJA1S-Q) [機器學習 入門(X 認識(O 01](/NKAOz3geTqijBhR9r82RZw) ## 電腦程式 首先,我們先來了解一下甚麼是程式 在維基百科中能看到電腦程式的說明 >電腦程式(英語:Computer Program)是指一組指示電腦或其他具有訊息處理能力裝置每一步動作的指令,通常用某種程式設計語言編寫,執行於某種目標體系結構上。 -wiki 在上文中,「某種目標體系結構」指的就是我們的cpu。 想當然,cpu只能依據數位電路(0與1)來執行功能,所以,程式實際上就是一連串位於記憶體由0與1組成的指令。 #### cpu 腳位圖 ![](https://i.imgur.com/Lkx0Fk4.jpg) >看不懂沒差,不影響,只是希望大家對數位電路(0與1)有點印象 ## 程式語言 > 打個比方,一個程式的原始碼就像一個用漢語(程式設計語言)寫下的紅燒肉菜譜(程式原始碼),用於指導懂漢語(編譯器)同時也會烹飪手法(體系結構)的人來做這道菜(程式) > -wiki 人類要只使用二進位碼(0與1)來編寫程式是非常困難的,所以我們需要程式語言的幫助才行 常見(以前),的程式語言如下 ![](https://i.imgur.com/KUvPkkE.jpg) >compile:編譯 >compiler:編譯器 簡單來說,就是由人們產出程式碼,再由編譯器編譯成二進位(0與1)的機器碼 ### 程式碼(原始碼) 程式碼,也就是程式在被編譯之前的狀態,會以文字的方式儲存。 >並不是甚麼特別的東西,你可以想成是一篇文法嚴謹、結構有序的文章 ## 單字介紹 1. code 泛指程式碼,有時候會叫source code 2. program 程式 3. syntax error 語法錯誤,相當於你文法錯了,編譯器看不懂 4. keyword 關鍵字,又稱保留字,該字在程式碼中具有規定好之意義 ## colab >Jupyter Notebook(前身是IPython Notebook)是一個基於Web的互動式計算環境,用於創建Jupyter Notebook檔案。Notebook一詞可以通俗地引用許多不同的實體,主要是Jupyter Web應用程式、Jupyter Python Web伺服器或Jupyter檔案格式(取決於上下文)。Jupyter Notebook檔案是一個JSON檔案,遵循版本化模式,包含一個有序的輸入/輸出單元格列表,這些單元格可以包含程式碼、文本(使用Markdown語言)、數學、圖表和富媒體 (Rich media),通常以「.ipynb」結尾附檔名。 -wiki 通俗點就是google提供我們能夠執行python程式碼的平台,並且易於複製,還可以直接與google drive 互動 注意:使用時須先登入google帳號,檔案會儲存於你帳號之雲端硬碟中 #### step1 ![](https://i.imgur.com/Loifz6L.jpg) #### step2 ![](https://i.imgur.com/bGgAnT8.jpg) #### step3 ![](https://i.imgur.com/gD1zdHe.jpg) ## Have a try ### 試試看 01 複製以下文字並執行 ```python= print('hello world') ``` ![](https://i.imgur.com/9jLHPvS.jpg) ### 試試看 02 ```python= x=1 y=2*x+1 print(y) ``` ![](https://i.imgur.com/4kU042f.jpg) 接著把"x=1"修改成"x=2"看看會發生甚麼事? ## next stage [python簡介與基礎語法](https://hackmd.io/BzyNykIDRFK7u31A8n5mjg)

    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