---
# System prepended metadata

title: 溫嘉泓 個人筆記 110251035

---

# 溫嘉泓 個人筆記 110251035
:::danger
您好，在麻煩您於week後面註記該週上課日期，謝謝。 by 助教
:::

# week 1~3  2月14日 2月21日 3月7日

### 例子:
```
import math
 print(math.floor(4.5)) #math.floor(取整數)
 print(math.ceil(4.5) )
```

* math.floor(取整數)
* print 為最後輸出 

### 把參數傳入涵數內

### 例子:日
```
import math 
x=math.ceil(1.4)
y=math.floor(1.4)
print(x)
print(y)
```

---
### 例子:
```
import math
x = (math.sqrt(7)-math.sqrt(5))/(math.sqrt(7)+math.sqrt(5))
y = (math.sqrt(7)+math.sqrt(5))/(math.sqrt(7)-math.sqrt(5))
x**3+y**3
```
### import math (工具箱的概念)

---
### 例子:
```
import math
x = (math.sqrt(7)-math.sqrt(5))/(math.sqrt(7)+math.sqrt(5))
y = (math.sqrt(7)+math.sqrt(5))/(math.sqrt(7)-math.sqrt(5))
x**3+y**3
```

### math.sqrt(根號)

---
# week 4 3月14日

### 例子:
```
thislist = ["apple","banana","cherry"]
print(thislist[0:3])
```

### 上面的apple是第0項，banana是第一項，cherry是第二項。
### [0:3]的意思是第0項到第3項

---
### 例子:
```
a = input("Enter a age:")
b = input("Enter b age:")
a=int(a)
b=int(b)
print(a+b)
```

答案:
Enter a age:10
Enter b age:10
20

---
# week 5 3月21日

### 例子:日

```
lst=["a","b","c","d","e,'f"]
lst[2]="x"  #lst編號為2的元素變成x
lst.append("c") #把元素加到最後面
lst.append("c")
lst.remove("b") #把元素刪除
print ( lst )
lst.sort()
print(lst.count("c")) #看哪個是重複的
```

---

### 例子:

```
lst=[1,2,3,4,5]
for x in lst : #回圈
  if x>2:
    print(x) #前面要加tab，令它宿排
    
```
---

# week 6 3月21日

### 例子:
```
a=[1,2,3,4,5]
for x in a : #後面不用加Tab
  print("in for loop")
if x>3: #段面有加 " : "
    print(x)
```

---
```
lst=[60474,17966,96949,7521,93184,13290,80559,23407,32934,71592,53071,34576,73225,3462,78216,59119,30438,76030,79730,52719,98568,15524,58507,29695,72782,17540,20441,10752,10368,15180,22476,89952,55597,79926,68829,14250,32526,63262,61107,48936,610,57348,47497,81307,8367,23222,88503,28267,99952,23017,65085,47323,49821,32584,30972,9306,92592,61028,60358,39581,43770,94085,2831,98577,9931,58366,10600,40871,33713,1943,66767,9008,38609,50848,35469,15344,56239,86374,92828,55399,81438,35771,28739,24107,73219,89005,20861,92589,78616,96892,50728,45848,14244,8317,41248,36275,44338,26250,65693,20100,49674,12638,77506,79208,92274,25047,44884,26438,71968,27278,84019,75581,45024,47008,29499,94332,67852,46627,75689,38086,66675,55510,99517,60920,16406,87296,21488,18666,46501,7931,37377,94523,24889,28897,10315,82434,80519,29107,44336,59352,23395,73953,21217,19202,90315,48111,27022,92919,96696,22907,98326,75601,51744,78102,69792,36919,31270,23196,22309,569,94654,20295,37463,8919,99690,88852,90442,60094,69823,19703,64637,99867,39237,80980,74844,39017,18123,17988,18758,78634,3900,60379,55664,75615,95607,84908,56887,37708,58283,36994,71767,34062,55478,89828,69537,18160,35602,29494,30669,15612,52730,83730,36887,14528,59823,10236,58379,14673,51888,33971,48235,65681,17805,89998,74435,35827,78983,91095,57954,26058,66204,6975,97470,77037,47456,9607,69076,32617,26242,45940,94631,94257,45348,26917,3597,5704,69491,51613,67360,35126,93154,78994,99492,4162,63247,614,83821,33381,10056,34381,71705,74457,88928,50610,78013,41957,21557,82585,30466,39203,51609,88352,2244,34762,45872,91011,17088,6790,67257,26855,48072,48567,64293,40010,91290,3476,97079,6450,82581,91910,15534,61864,21908,65746,39500,82936,63954,88610,43249,39700,10793,66872,79996,92659,80228,9448,36590,61013,63469,26326,45445,47884,73967,21421,41899,19425,59210,36787,46378,56889,21495,43109,39921,9629,63582,19728,59478,34575,13151,3160,80212,81673,12398,29540,46928,50948,92761,86367,18091,63985,16796,75872,29856,57874,76781,92032,77341,67395,1210,26808,97008,73529,21358,65406,57923,74493,33171,21373,39342,75194,73467,69751,7697,97136,26415,70025,67578,59263,9695,75549,3704,83015,44715,6355,94385,99832,52454,83896,95925,72639,63444,94120,53960,8562,78817,28772,19604,6988,95929,95999,14315,86760,76211,23417,57539,5172,22222,22066,86309,80030,10268,68539,88993,30638,64092,25792,25528,72472,85757,28298,58715,14301,93604,40702,67783,55978,82709,73851,75038,25531,38871,17120,19271,82070,46602,91853,6345,91049,88101,15101,11779,6937,14933,74936,86133,89392,39264,3452,67439,82525,31475,48481,35519,98495,7668,84749,50908,36193,15074,9943,32107,2454,78780,17441,73188,52262,12251,26378,88538,64900,26907,21220,42911,80689,19391,90065,52189,52659,84670,88416,49692,35312,52707,38748,94510,66022,38210,46574,30275,86702,94672,6859,40450,89265,9116,18408,43824,87379,43610,87405,57130,70461,7967,81441,86876,83236,23967,58510,72518,32186,3873,70751,75079,22076,88073,8094,4970,93711,30998,20906,76629,47752,84911,31192,92113,75978,916,56421,55344,49046,6966,906,559,97913,28989,28883,6673,60028,80743,31948,71555,84297,12306,35094,66324,86015,88965,22594,46507,50596,87151,78700,68888,60814,89127,73980,58956,90709,26727,77493,7075,16224,57058,67500,66243,39027,32113,46728,60235,55317,55742,48032,55701,97697,20978,92715,37691,66691,35911,61606,82544,96662,36618,66005,44064,83106,7252,57263,90880,86945,97148,93141,7807,2158,94743,53134,52161,44451,83301,26224,67045,41691,36845,96128,56995,96052,49665,77379,21994,12101,50781,20754,31528,14421,60652,61289,87165,43245,81328,99739,67422,62196,62054,26905,64093,37926,46451,15815,62532,32190,92588,51428,59333,80126,84301,6168,35580,41369,59051,63554,53901,40095,62267,89278,16920,97229,52355,28772,6914,3501,85171,98735,76454,96349,46418,28947,541,91375,7952,44510,93425,63661,12004,57208,7070,93393,57434,42489,83896,45284,88835,29183,80434,13657,82776,1603,41967,68000,45223,96843,48292,67776,58436,99792,31665,52951,5522,99140,76258,73437,26591,61873,71810,67653,94574,79167,30600,86199,79441,56074,67194,89844,41060,20481,9736,13111,82822,99654,84090,2789,52637,36230,77089,21133,45263,54075,20490,78147,79307,94458,21291,32662,54777,77369,20061,37415,90747,3986,86743,71143,56036,30041,87021,71480,27905,74425,91619,34398,84115,29960,93170,53829,59936,32507,18886,25900,10733,50702,67533,84141,53024,79655,83924,14916,93701,24564,84376,1008,6671,33780,62350,68628,70665,12685,9513,24293,41579,56848,57664,82633,35302,46170,12039,25451,52995,68637,32448,21123,18192,60572,75160,36053,56135,66903,26351,50447,52485,43290,45181,46527,17594,64269,20066,32353,73597,85298,1735,37705,93019,93115,99872,23406,41006,26152,73624,88968,44229,11071,22834,40419,37824,19242,30767,37724,34603,44863,53402,14986,84614,22704,55032,7696,79197,90976,54602,17729,72995,88492,53301,77950,19428,29406,90649,29720,43448,17250,29641,87767,37312,78671,52406,59912,98235,97169,14969,35170,56749,71954,6300,66,74337,80048,86325,43251,60685,35196,81393,55588,29910,74193,62810,89124,51834,35790,71976,29880,33740,50152,53503,70096,37842,39555,42783,85955,66714,89907,58554,46412,35883,79642,39000,7557,90735,32707,67678,94646,71467,98581,60029,46083,20384,54084,61437,93525,29061,74883,69115,48006,72679,84083,80011,91330,93250,56278,72601,89269,78193,80427,70237,37724,60329,77822,97563,34200,10799,45878,53492,13908,21883,11098,92929,33389,5176,38927,53380,23667,57248,75461,96729,41616,23908,73188,47394,83216,15678,14966,89285,78562,18500,65491,15701,36043,29544,90224,55044,2805,55240,4076,62952,59260,35103,73696,72740,27671,56186,81530,54220,78740,18390,1788,65513,20311,25507,94132,85910,72418,32787,40910,65682,73274,91053,92856,24527,59648,9922,21190,35254,19773,20016,14120,43837,97898,5071,68705,15689,77188,45124,41379,8266,59847,72765,96880,97889,42809,7592,59273,253,52574,23282,56491,24496,94267,83905,56776,99059,5045,47520,60227,14569,71282,91760,99493,78543,96843,83285,33663,52042,44303,58556,11784]
a=0
for x in lst:
  a=x+a
print(a) #不用加tab，是因為在回圈外

b=0
for x in lst:
  if x>b:
    b=x
    print(b)
    
```
答案:
51852342
60474
96949
98568
99952

---
# week 7 3月28日
 
### 例子:
 ```
dic={'WaterMelon':100, 'Apple':40}
print( dic['WaterMelon'] )
```

### 例子:
```
dic={5:100, 6:40}
print( dic[5] )
```

### 例子:
```
dict = {
  "109213504":"麥禮仁",
  "110211049":"稅正祺", 
  "110211003":"林志宬",
  "110251009":"王博賢",
  "110211026":"洪權佑",
  "110211012":"黃玉柔",
  "110211028":"陳宜樺",
  "110211016":"林依嫻",
  "110251027":"郭姉祐",
  "110251001":"董哲安",
  "110251002":"高證鎰",
  "110251049":"陳昱慈",
  "110251016":"王麗婷",
  "110251014":"謝欣伶",
  "110251044":"王之賢",
  "110211050":"江柏逸",
  "110211005":"陳禹侖",
  "110211018":"楊凡寬",
  "110211027":"林昌興",
  "110211047":"趙梓豐",
  "110211008":"周芃君",
  "110211004":"鍾孝歆",
  "110211025":"黃巧瓈",
  "110251008":"陳韋蓁",
  "110251010":"劉姸希",
  "110251050":"鄭捷方",
  "106213050":"朱昱丞",
  "110211040":"陳亨毓",
  "110251039":"黃凱葶",
  "110251035":"溫嘉泓",
  "110211052":"林世鎧",
  "110211034":"洪橞䈶",
  "110251043":"許家維",
  "110251040":"陳柔云",
  "110211013":"顏庭茂",
  "110251041":"魏敏如",
  "110251037":"蔣水晶",
  "110211046":"何思雅",
  "110211002":"王敏甄",	
  "110251018":"李佳臻",
  "110211058":"鄭宜蓁",
  "110211030":"劉昱岑",
  "110211060":"吳宜軒",
  "110251030":"溫瑩瑄",
  "110211009":"李佳蓁",
  "110211037":"粘伊萱",
  "110211041":"戚佩琳",
  "110251029":"廖韋茹",
  "110211062":"王郁亨",
  "109211067":"古宇立",
  "108251026":"許詠翔",
  "110251020":"王雅蓁",	
  "110251017":"韓育欣",	
  "110251023":"陳懷恩",
  "110211032":"郭芝榛",
  "110211051":"林秉楓",
  "110251021":"潘妘昕",
  "110251019":"林益任",	
  "110251051":"王方琦",
  "110251028":"傅翊安",
  "110211014":"陳柏勳",
  "110251003":"陳千晴", 
  "110251004":"翟品荃",
  "110251013":"江羽晴",
  "110251012":"陳玟伃",
  "110251005":"陳品蓉",
  "110251026":"王愉盛",
  "110211031":"江以薰",
  "110211022":"吳姿儀",
  "110211007":"譚厚誼",
  "110211053":"廖振羽",
  "109251040":"傅善鉑",
  "110211036":"葉平超",
  "110211024":"蕭逸韋",
  "110211029":"張彥程", 
  "110211061":"陳柏揚", 
  "110211023":"薛皓均",
  "110211015":"吳玗苀",
  "110251015":"吳依蓁",
  "110251032":"黃元泓",
  "110251045":"劉冠伯",
  "110211011":"黃翊喆",
  "110211055":"吳耀登",
  "110251006":"陳薏如",
  "110251038":"周宗永",
  "110211063":"陳玉珊",
  "110251011":"趙奕媗",
  "110211033":"蘇家陞",
  "110251024":"邱亮云",
  "110251047":"盧承徵",
  }


#dict是字典的指令，然後要加print(dict[""])
print(dict["110251035"])
print(dict["109213504"])
for x in dict.values():
  if "陳" in x:
    print(x)
```
    
### 例子:

```
txt="今天天氣很不好，下雨，又很冷"
print(txt[0:6]) #第0項到第6項
print(txt[:])
print(len(txt))#len是長度的意思
print(txt.find("好")) #找出來位子是第幾項
```

1. 要import matplotlib.pyplot as plt(導入資料視覺化模組)
2. 加入串列(x,y軸的值)
3. plt.scatter(分別拿兩串列定義x,y軸的值,並以s大小決定圖形上對應座標的點的大小)
4. plt.axis(設定圖形形狀)
5. 以plt.xlim、plt.ylim設定x,y軸長度

## 例子:

```
import numpy as np
import matplotlib.pyplot as plt
a=[1,2,3,4,5]
b=[1,2,3,4,5]

plt.scatter(x=a,y=b,s=20) 
plt.axis('square')
plt.xlim(0,10)
plt.ylim(0,10)

print(f'我的圖形')

plt.show()
```
---
# week 9 4月11日

#### 例子:

> #手工掛載雲端硬碟
> #寫入CSV
>
>  with open('/content/drive/MyDrive/___TestData/001_Hello.txt', 'w') as f:
>   f.write('Hello Google Drive,溫嘉泓')

#### 要下載文件後才能操作