---
# System prepended metadata

title: Untitled

---

SSH 登入
```bash=
ssh pi@127.0.0.1
```

Rassbian系統設定表單
```bash=
sudo raspi-config
```

改密碼
```bash=
sudo passwd pi
輸入新密碼:
raspberry
```

## swap function
```python=
def myswap(array, idx1, idx2):
    tmp = array[idx1]
    array[idx1] = array[idx2]
    array[idx2] = tmp

a = [1, 2, 3, 4]
myswap(a, 0, 2)
print(a)
```

## Bubble Sort
```python=
def myswap(array, idx1, idx2):
    tmp = array[idx1]
    array[idx1] = array[idx2]
    array[idx2] = tmp
    
def bubble_sort(a):
    a_len = len(a)
    for i in range(a_len):
        for j in range(a_len):
            if a[i] > a[j]:
               myswap(a, i, j) 

a = [3, 1, 2, 4]
print(bubble_sort(a))
```

```python=
def mysum(array):
    sumnum = 0
    for idx_num in array:
        sumnum = sumnum + idx
    return sumnum

a = [1, 2, 3, 4, 5]
print(mysum(a))
```

python 基本語法:
```python=
if a == 1:
    1 == 1
    
while 1:
    1 == 1
    
for i in range(5):
    print(i)
    
```