Skip to content

Commit

Permalink
Add 2024 intern
Browse files Browse the repository at this point in the history
  • Loading branch information
JackChen890311 committed Jun 28, 2024
1 parent 6c3aa30 commit 1616ccb
Show file tree
Hide file tree
Showing 9 changed files with 924 additions and 133 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"server": "hexo server"
},
"hexo": {
"version": "6.3.0"
"version": "7.1.1"
},
"dependencies": {
"hexo": "^7.1.1",
Expand All @@ -29,4 +29,4 @@
"hexo-theme-landscape": "^1.0.0",
"hexo-wordcount": "^6.0.1"
}
}
}
688 changes: 688 additions & 0 deletions source/_drafts/dsa-tutorial.md

Large diffs are not rendered by default.

56 changes: 0 additions & 56 deletions source/_drafts/summer-intern-2024.md

This file was deleted.

9 changes: 4 additions & 5 deletions source/_posts/python-tutorial-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,10 @@ The loop ends.


#### 變數(Variable)
- 我們會需要變數來存放數值運算的結果
- [基本命名規則](https://ithelp.ithome.com.tw/articles/10217188)
- 我們會需要變數來存放數值運算的結果,使用 `=` 可以將數值指派給變數,可以參考 [基本命名規則](https://ithelp.ithome.com.tw/articles/10217188)
- 若重複指派給相同名稱的變數,原本的值會被覆蓋掉!
- `a = 10` 意為指派 10 給 a(右邊的值丟給左邊的容器)
- `a == 10` 意為比較 a 是否等於 10(為邏輯判斷式)

```
>>> width = 20
>>> height = 5 * 9
Expand Down Expand Up @@ -128,8 +127,8 @@ The loop ends.
- 字串 string - `"This is a string"`
- 布林值 Boolean - `True` (Non-zero) / `False` (Zero)

> 補充:String 是由 Character 組成的陣列,為了便於操作在 Python 內多使用 String
> Python 在讀入長度為一的字母時,為了方便也會以 String 的方式儲存
> 補充:String 是由 Character 組成的陣列,其他語言有可能會將 String 與 Character 當作兩種資料類別,但在 Python 中沒有 Character 的概念,因此長度為一的字母在 Python 中也會被當成字串來做處理。
#### 型別轉換(Casting)
```
>>> str(3)
Expand Down
14 changes: 7 additions & 7 deletions source/_posts/python-tutorial-3.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ The loop ends.
- 示範:

```python=
while 4 > 3: # A Condidtion always True
while 4 > 3: # A always true condidtion
print('Loop')
```

#### Range()
- 幫助我們創造一個範圍的函數
- 用法:
- `range(n)` 會回傳 `[0,1,2,...n-1]` 的清單
- `range(m,n)` 會回傳 `[m,m+1,m+2,...n-1]` 的清單
- `range(m,n,k)` 會回傳 `[m,m+k,m+2k,...]` 的清單,最後一個元素不超過 n-1
- 一般狀況使用第一個就好
上面的例子中有使用到 range(),而 range() 是能夠幫助我們創造一個範圍的函數,其用法為:
- `range(n)` 會回傳 `[0,1,2,...n-1]` 的清單
- `range(m,n)` 會回傳 `[m,m+1,m+2,...n-1]` 的清單
- `range(m,n,k)` 會回傳 `[m,m+k,m+2k,...]` 的清單,最後一個元素不超過 n-1

一般的情況下使用第一個就好。

> 備註:回傳型態其實不完全是清單,但我們先把它當成清單用就好
> 可以透過 `list()` 將其轉為清單
Expand Down
9 changes: 6 additions & 3 deletions source/_posts/python-tutorial-4.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ date: 2023-03-23 20:54:38
>>> print(l + l)
[1, 1.0, 100, "test", 1, 1.0, 100, "test"]
>>> print(l * 3)
[1, 1.0, 100, "test", 1, 1.0, 100, "test", 1, 1.0, 100, "test"]
```
- Traverse a list:

Expand Down Expand Up @@ -103,9 +106,9 @@ Output:
# Correct Copy
aList = [1, 2, 3]
# Three different ways to copy a list (Shallow)
anotherList = list(a)
anotherList = a[:]
anotherList = a.copy()
anotherList = list(aList)
anotherList = aList[:]
anotherList = aList.copy()
anotherList[0] = 5
print(aList)
Expand Down
Loading

0 comments on commit 1616ccb

Please sign in to comment.