---
# System prepended metadata

title: '**第25組共筆筆記**'

---

# **第25組共筆筆記** 
林秉楓110211051 張彥程110211029 蔡至洹110211057 陳薏如110251006
[TOC]
### 第一週小組共筆
1. 指令
    輸出 print() #要輸出非變數與參數時須加上上引號
    ex:
    ```python=
    print("程式設計")
    # 執行結果：程式設計
    x=2
    print(x)
    # 執行結果：2
    ```
    :::danger
    - 程式碼的部分可以善用共筆標籤框起來，如上(請看編輯模式)
    - python 中的註解方式：在註解前方加上一個 # 
    > [name=By 助教]
    :::
    輸入 input()
2. Python Arithmetic Operators
  +(加)
  ex:
    x=5
    y=6
    print(x+y)
    11
  -(減)
  ex:
    x=6
    y=5
    print(x-y)
    1
  *(乘)
  ex:
    x=6
    y=5
    print(x*y)
    30
  /(除)
  ex:
    x=6
    y=3
    print(x/y)
    2
  %(模除)
  ex:
    x=5
    y=2
    print(x%y) #5/2=2.....1 5%2=1
    1
  **(次方)
  ex:
    x=2
    print(x**3) #2*2*2=8
    8
  // (取商數)
  ex:
    x=5
    y=2
    print(x//y) #5/2=2.....1 5//2=2
    2
3. Python Assignment Operators
  =(指定)
  ex:
    x=5 #將5指定給x
  +=
  ex:
    x = 5
    x += 3 #same as x=x+3
    print(x)
    8
  以此類推任何的Arithmetic Operators加上=(任意數字)後皆變成x=x Arithmetic Operators(任意數字)
4. Python Comparison Operators
  ==(相等) #須注意=跟==不一樣，x=y是將y指定給x，而x==y是x與y相等
  ex:
    x=3
    y=3
    x==y
    ture
  !=(等式不相等)
  ex:
    x=3
    y=2
    x!=y
    ture
  <(小於)
  >(大於)
  <=(小於等於)
  >=(大於等於)
5. Python Logical Operators
  and 符號&(兩者皆須符合)
  ex:
    x=5
    x<6 and x>3
    ture
  or 符號|(兩者只須符合一個即可)
  ex:
    x=5
    x<6 or x>6
    ture
  not 符號~(否定)
  ex:
    x=5
    print(not(x > 3 and x < 10))
    false
6. 程式執行順序
  ex:
    x=5
    y=6
    print(x+y)
    11
    這段程式碼中電腦是先將5指定給x，再將6指定給y，之後先計算print括號內的x+y最後再將x+y輸出。
 
###  第二週小組筆記
 1.![](https://i.imgur.com/z1BTPrI.png)
 x=2**(1/2)
 y=7**(1/2)
 print(x*y)
 ![](https://i.imgur.com/Yas2NeX.jpg)

 3.7416573867739418
2.![](https://i.imgur.com/yszgvW5.png)
 121**2+(2*121*79)+79**2
 40000
3.![](https://i.imgur.com/4i4m9Fb.png)
 10**6*((10**2)**3)/10**4
 100000000.0
 ![](https://i.imgur.com/Nh0WDQQ.jpg)

 
110211057 蔡至洹
1.![](https://i.imgur.com/kqNFFEK.jpg)
 168*317
 53256
 ![](https://i.imgur.com/XbM4ZhP.jpg)

2.![](https://i.imgur.com/VRyTqIj.jpg)
 6/(12-(2*(27**(1/2))))**(1/2)
 4.732050807568878
 ![](https://i.imgur.com/ipIRScA.jpg)

3.![](https://i.imgur.com/o1ZcUbA.jpg)
 ((3+(5**(1/2)))/2)**(1/2)
 1.618033988749895
![](https://i.imgur.com/pNVd7VF.jpg)

 
110211029張彥程
1.![](https://i.imgur.com/EMo0qpW.jpg)
 (4038**(1/2)+4036**(1/2))*(2019**(1/2)-2018**(1/2))
 1.41421356237317
 ![](https://i.imgur.com/2NhmpXY.jpg)

2.![](https://i.imgur.com/9TOJIQh.jpg)
 (30**3+40**3+50**3)**(1/3)
 59.999999999999986
3.![](https://i.imgur.com/HaVcCm8.jpg)
 ((3*(2**(1/2)))-(2*(3**(1/2))))**2**(1/2)
 0.7018548182130425
 
 110211051 林秉楓
1.![](https://i.imgur.com/ayQ3yXq.jpg)
Ans:8.05
![](https://i.imgur.com/uUjuXjD.jpg)

2.![](https://i.imgur.com/TnKLWA8.jpg)
Ans:177
![](https://i.imgur.com/EXahd3f.jpg)

3.![](https://i.imgur.com/56vbiQg.jpg)
Ans:1.05
![](https://i.imgur.com/XLIQdoU.jpg)
![](https://i.imgur.com/J7Mp3Oh.jpg)




### 第四周小組筆記 
Python 基本語法

Indentation(縮排)
![](https://i.imgur.com/2LA96iV.png)
(1)使用時，必須要有空格，沒有空格，會被給錯誤

Ex:
![](https://i.imgur.com/uHQTi1t.png)

(2)需使用相同數量的空格，否則會被給錯誤

Ex:![](https://i.imgur.com/O7kLOJ9.png)

第四週小組作業
mylist=[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]
![](https://i.imgur.com/nUaiZd9.jpg)

### 第五周小組筆記
mylist=sorted(mylist)
print(mylist)
print(len(mylist))
print(min(mylist))
print(max(mylist))
1.使用迴圈求總和
![](https://i.imgur.com/DoWMpus.png)
2.利用迴圈求最大值
![](https://i.imgur.com/nMYjeOI.png)
3.使用迴圈求項數
![](https://i.imgur.com/C2VUNkA.png)

:::danger
- 請同學可以善用共筆中的各種標籤，如第一周共筆更改內容，附上 [共筆使用教學](https://hackmd.io/@wootu/SkY0M5wsZ?type=view)
- 因上課週數多，請同學改用[書本模式](https://hackmd.io/s/how-to-create-book-tw)，未來閱讀筆記時較方便閱覽
- 更改為書本模式後，共筆連結有所異動請再寄信聯絡助教`s108213039@mail1.ncnu.edu.tw`
> [name=By 助教]
:::
### 第六周小組筆記
1找出麥禮仁學號
```python=
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":"盧承徵",
  }
for x,y in dict.items():
  if y=="麥禮仁":
    print(x,y)
```
2找出姓陳的姓名
```python=
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":"盧承徵",
  }
for x,y in dict.items():
  if"陳"in y:
    print(x,y)

```
3歡迎某某某參加我們的營隊活動
```python=
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":"盧承徵",
  }
for y in dict.values():
 print("歡迎"+y+"參加我們的營隊活動")

```
4找出所有姓氏
```python=
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":"盧承徵",
  }
b=set()
for i in dict.values():
  b.add(i[0:1])
print(b)
```
5找出所有姓氏出現的次數
```python=
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":"盧承徵",
  }
b=set()
c=list()
a=0
for i in dict.values():
  b.add(i[0:1])
  c.append(i[0:1])
for i in b:
  for j in c:
    if i==j:
     a=a+1
  print(str(i)+"出現了"+str(a)+"次")
  a=0
```
![](https://i.imgur.com/48Bx7ws.jpg)
###  4/11小組筆記
橫著印出學號 體重 身高
![](https://i.imgur.com/WbRQpsl.jpg)

將表格全部元素全部印出來（使用雙迴圈）
![](https://i.imgur.com/zIzxS7b.jpg)
![](https://i.imgur.com/Nz9sSdB.jpg)
### 4/25小組筆記
加分題討論

```python=
dfLorenz=dfIncome[:]
se=dfLorenz['Income'].sort_values()
cumulativeSum=0
i=0
# 宣告xx為串列變數
xx=[]
# 宣告yy為串列變數
yy=[]
# 手動追蹤看看
for x in se:    
    i=i+1
    cumulativeSum+=x
    xx.append(i/n)
    yy.append(cumulativeSum/sum)

plt.plot([0,1], linestyle = 'dotted')

#散佈圖
plt.scatter(x=xx,y=yy,s=0.1)
plt.axis('square')
plt.xlim(0,1)
plt.ylim(0,1)

print('羅倫茲曲線（Lorenz curve）')
plt.show()
```
![](https://i.imgur.com/gdNW6v6.png)

```
期中考檢討
```

```python=
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)
```

```python=
list = [1,2,3,4,5,6,7,8,9]
for i in list:
  for j in list:
    print(i,"x",j,"=",i*j)
```
```python=
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)
```
```python=
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])
```

```python=
import pandas as pd
 
 
grades = {
    "姓名": ["小明", "小美", "小花", "小華","小文"],
    "國文": [71,80,58,59,44],
    "數學": [92,15,66,70,68],
    "英文": [68,99,63,72,87]
}
 
df = pd.DataFrame(grades)

#(1)
print(df)
print("----")
#(2)
print(df.loc[[0,2],["姓名","國文","數學"]])
print("----")
#(3)
df.at[3,"英文"] = 77
print(df.loc[[3],["姓名","英文"]])
print("----")
#(4)
print(df[df["國文"] < 60])
```
```python=
breakfast = {"香煎培根堡":35,"鮮蔬起士堡":40,"花生培根山明治":60,"花生燻雞山明治":65,"洋芋蛋沙拉手捲餅":45,"香草豬排手捲餅":55}

#(1)
print("-----")
print(breakfast)
#(2)
print("-----")
print(breakfast.get("花生培根山明治"))
#(3)
print("-----")
for i in breakfast:
  print(i)
#(4)
print("-----")
for i in breakfast:
  breakfast[i] += 5
print(breakfast)
```
```python=
employee = {"001":"王重陽","002":"張三丰","003":"謝遜","004":"謝安","005":"李世民","006":"謝靈運"}

#(1)
print("-----")
print(employee)
#(2)
print("-----")
for a,b in employee.items():
  if "謝" in b:
    print(a,b)
#(3)
print("-----")
nameList = set()
for i in employee.values():
  nameList.add(i[0])
print(nameList)  
#(4)
print("-----")
for i,j in employee.items():
  print(f"歡迎{i}號員工{j}入職")
```

![](https://i.imgur.com/NzX0r0c.jpg)
### 5/2小組筆記
1討論期末專題
2上課筆記
```python=
price=8
amount=9
total=price*amount
print(f'你購買{amount}個蘋果，每個單價{price}錢，總價為{total}')
```


Dataframe
![](https://i.imgur.com/2BtRz4c.png)
掛接雲端硬碟
![](https://i.imgur.com/VHLrczp.png)
開會紀錄
![](https://i.imgur.com/lYSdEg2.png)
### 5/9小組筆記
研究題目：台灣各縣市台綜合所得總額(平均數)分佈之研究

國立暨南國際大學 經濟系 林秉楓

國立暨南國際大學 經濟系 蔡至洹

國立暨南國際大學 經濟系 張彥程

國立暨南國際大學 管院不分系 陳薏如

聯絡方式：

1.s110211051@mail1.ncnu.edu.tw

2.S110211057@mail1.ncnu.edu.tw

3.S110211029@mail1.ncnu.edu.tw

4.s110251006@mail1.ncnu.edu.tw

研究背景

5月是我國申報綜合所得稅的月份，綜合所得稅是國家針對個人在一年內的淨所得課徵的稅，為我國重要的財政收入，是以採用累進稅率的方式來進行課稅，因此我們決定以貼近現階段大家都在進行的活動為專題內容，而我們在網路上找到來自財政資訊中心「綜合所得稅結算申報統計專冊」所統計的資料，是一份來自各縣市及鄉鎮市區的數據，為我國106年各縣市綜合所得稅結算申報情形做為主題，取用各縣市及鄉鎮市區綜合所得稅的中位數(以千元作為單位)來計算，想得知各縣市及鄉鎮市區的綜合所得稅結算申報情形的差異，並將這些數據分析並整理打成一份EXCEL檔，爾後使用Colaboratory匯入檔案來做不同項目的運算，寫入程式來做觀察與研究，分別寫出收入與人數直方圖，羅倫茲曲線（Lorenz curve）與吉尼係數（Gini Coeffient)的程式碼，羅倫茲曲線（Lorenz curve）分析各縣市及鄉鎮市區的綜合所得稅分配的均衡或不均衡，吉尼係數得出的程式碼（Gini Coeffient)分析各縣市及鄉鎮市區的綜合所得稅的平均度，以上的項目均計算結果並得出研究發現，最後寫出總結。

研究問題
我國各縣市及鄉鎮市區綜合所得稅之研究與發現

**資料來源**

來自財政資訊中心「綜合所得稅結算申報統計專冊」所統計的資料

為我國106年各縣市綜合所得稅結算申報情形


```python=
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
dfIncome = pd.read_excel('/content/drive/MyDrive/綜合所得總額-平均數.xlsx')
dfIncome
```
![](https://i.imgur.com/mmzVp4N.png)



**收入與人數直方圖**

從直方圖中，我們可以發現到多數縣市集中在平均收入的後段班，這顯示了升入不平均，富者恆富，窮者恆窮
```python=
#總收入與人數
sum=dfIncome['綜合所得總額-平均數(千元)'].sum()
n=dfIncome['綜合所得總額-平均數(千元)'].count()
print(f'總和={sum}, 樣本數={n}')
#直方圖
plt.hist(dfIncome['綜合所得總額-平均數(千元)'], bins=range(700, 1400, 10))
plt.show()
```

![](https://i.imgur.com/3reeFzT.png)
**羅倫茲曲線（Lorenz curve）**


```python=
dfLorenz=dfIncome[:]
se=dfLorenz['綜合所得總額-平均數(千元)'].sort_values()
cumulativeSum=0
i=0
xx=[]
yy=[]
for x in se:    
    i=i+1
    cumulativeSum+=x
    xx.append(i/n)
    yy.append(cumulativeSum/sum)
plt.plot([0,1], linestyle = 'dotted')
plt.scatter(x=xx,y=yy,s=10,linewidths=1,c='darkblue',marker='o')
plt.axis('square')
plt.xlim(0,1)
plt.ylim(0,1)
print('羅倫茲曲線（Lorenz curve）')
plt.show()
```
![](https://i.imgur.com/UW98C64.png)

**吉尼係數（Gini Coeffient)**
```python=
dfLorenz=dfIncome[:]
se=dfLorenz['綜合所得總額-平均數(千元)'].sort_values()

#家戶收入
incomes=[0]

#戶數累積百分比
cumulativePercentage=[0]

#所得累積百分比
cumulativeSum=[0]

#戶數
n=se.count()

#全體總收入
sum=se.sum()

#暫存變數
cum=0
pr=0

for _income in se:
  incomes.append(_income)
  pr+=1
  cum+=_income  
  cumulativePercentage.append(pr/n)
  cumulativeSum.append(cum/sum)

#計算曲線下的面積
#用integral代表面積
integral=0

for i in range(1,n+1):
  #計算圖中梯型的面積
  #梯型面積計算公式：(上底+下底)*高*2
  #程式碼為 (cumulativeSum[i-1]+cumulativeSum[i])*(1/n)/2
  #說明：
  #(cumulativeSum[i-1]+cumulativeSum[i])==>(上底+下底)
  #(1/n(戶數))==>高
  integral+= (cumulativeSum[i-1]+cumulativeSum[i])*(1/n)/2
  #畫出10個梯型給同學參考
  #     x = x[i]到x[i] , y = 0到y[i]
  plt.plot([cumulativePercentage[i],cumulativePercentage[i]],[0,cumulativeSum[i]])
#下圖為一個正方形大小為1*1，要計算的地方只有期中的一半 = 0.5
#一半的正方形-每個不同顏色梯形面積總和/一半的正方形(可參照標準吉尼係數公式)
gini=(0.5-integral)/0.5
print(f'吉尼係數={gini:.4f}')
```
![](https://i.imgur.com/OZtovtz.png)


**研究發現**

　羅倫茲曲線是把低所得用戶到高所得用戶分為五等分，每等分都等於20％，橫軸為家戶累積百分比，縱軸為所得累積百分比，上方的上彎曲線即為羅倫茲曲線，圖中對角線為絕對均等線，若羅倫茲曲線越靠近對角線，那代表所得越平均分配；反之，離對角線越遠，所得分配越不均。由圖中底線和右邊邊線形成的直角線，為絕對不均線。

　　吉尼係數是圖中對角線和羅倫茲曲線所形成的半月形面積，其數字一定介於0(絕對均等)和1(絕對不均)之間

０＜吉尼係數＜１

越接近１綜合所得稅不均越大 反之，越接近０綜合所得稅不均越小。

然而從程式中計算可以算出台灣縣市綜合所得稅分佈的吉尼係數是0.929，依照聯合國開發計劃署等組織規定：
* 若低於0.2表示指數等級極低；
* 0.2-0.29表示指數等級低；
* 0.3-0.39表示指數等級中；
* 0.4-0.59表示指數等級高；
* 0.6以上表示指數等級極高。
通常，0.4是所得分配差距的「警戒線」，超過這條「警戒線」時，貧富兩極的分化較為容易引起社會階層的對立從而導致社會動盪。
由此可知台灣的縣市綜合所得稅分佈是極度不均的狀態，然而台灣綜合所得稅是依照所得比例去做調配，因此台灣縣市綜合所得稅分佈不均也等同於是台灣縣市的所得分佈不均，這也就代表台灣目前的城鄉差距是明顯過大的情形。

**結論**

我們國家的收入分配分佈是極度不均的
理論上，這代表者
1.縣市平均收入差距極大
2.城鄉差距問題嚴重
在實務上，我們建議政府應該採取下列作為 :
1. 多投入工藝創作、有機農業等產業，增加就業機會，減緩人口流失
2. 打造城鄉共同體，規劃生活圈，共創經濟成就
3. 加強地方認同
總之在上述表格及數字中，我們可以發現到縣市之間存在龐大收入差距問題，舉個
例子，收入平均數最高的縣市為台北市，為133.4萬元，而收入平均數最低的縣市為南投
縣，為74.1萬元，差了快兩倍的平均年收入，可見問題相當嚴重。其實這件事件可以歸因
於城鄉差距，看表格可得知，收入平均數高的前幾名縣市大多是直轄市，新竹縣則是有發
展高科技產業，所以大大提升年收入，至於倒數幾名的縣市，大多則是東部地區或是傳統
農業大縣（南投、雲林等…），這些地區落後的問題可能是缺乏教育機會，加上就業機會少
，交通便利性差等原因，像大部分的直轄市都有設立捷運，大大提升就業便利性，在加上
許多明星學校也匯聚於此區域，所以使大量年輕人移入都市生活，而那些人口大量流失地
區則變成了「老人村」，缺少活力及地區活化，所以大大減緩了開發。俗話說：「減緩城鄉差
距是社會穩定的基礎。」要解決此問題的方法也是很多元，例如投入工藝創作及有機農業
的行列，如此一來可以提高就業機會，也可以使年輕人回來發展。但做這些事的前提是要
先了解自己地區到底適合什麼，使鄉村傳統資源重新認定，並且隨著時代趨勢，發展地區
真正適合的產業，而不是一昧盲從。而政府應扮演協助者的角色，許多提案及建設都需要
政府大力支持才有成果。而每次選舉時，我們應該選擇真正愛這個地方及有方法及有實踐
的候選人，而不是因自身利益或因政黨喜愛所選，這樣只會造成不良的惡性循環，地方發
展只會更落後而已。最後，城鄉必須要多元發展，才可以創造台灣的經濟及文化高峰。
**colab網址**
https://colab.research.google.com/drive/1olWVYsVk9R_r-pKCM2UdupuwpdLVBLry?usp=sharing#scrollTo=JZWq_guh4sV7





![](https://i.imgur.com/aQk8ght.png)
### 5/16小組筆記
定義一個函數
```python=
def my_function():
  print("Hello from a function")
```

```python=
def my_function(x,y,z):
  s=x+y+z
  return s
```
```python=
s=0
n=10
for i in range(0,n+1):
  s=s+i
  
print(s)
```
```python=
def my_function(m,n):
  s=0
 
  for i in range(1,n+1):
    s=s+i
  return s
```
```python=
def myFun(x):
  print(x+'您好')
myFun('小明')
```
```python=
def myFun(x,y):
  print(x+'您好:'+y)
  
myFun('小明','早餐吃了沒?')
```

![](https://i.imgur.com/mNjB49K.png)

### 5/23小組筆記
05/16 課堂小考
1.請定義一個函數myFunction，傳入一個參數n。此函數可以計算出1,2,…,n的總和。函數能傳回後的總和。（必須用for迴圈完成）
```python=
def myFunction(n):  # 定義一個函數，將其命名為myFunction
  sum = 0  # 宣告一個變數sum，其初始值為1
  for i in range(1, n+1):  # 使用for迴圈，其範圍從1至n+1，因range不含尾端數字故須填n+1
    sum += i  # sum = sum + i
  return sum  # 回傳 sum

print(myFunction(10))  # 舉例從 1 + 2 + 3 + ... + 10
```
2.請定義一個函數myFunction，傳入一個參數n。此函數可以找出1,2,…,n的之間2的倍數，並列印出到螢幕上。（必須用for迴圈完成）
```python=
def myFunction(n) : # 定義一個函數 myFunction，傳入一個參數 n
    for i in range(1,n+1) : # for loop 跑小於等於 n 的所有值
        if(i % 2 == 0) : # 若 i 除 2 的餘數為零，則表示 i 是偶數
            print(i, end=' ') # 列印不換行
myFunction(int(input())) # 呼叫 myFunction 並將 input 值作為參數傳入
```
3.請在螢幕上印出如下圖案 （必須用for迴圈完成）
![](https://i.imgur.com/xgzFwDm.png)
```python=
def myFunction(n) : # 定義一個函數 myFunction，傳入一個參數 n
    for i in range(n) : # for loop 跑小於 n 的所有值
          print((2*i+1) * "*") 
myFunction(7) # 呼叫 myFunction 並將傳入參數 7
```
05/23 課堂小考
1.請定義一個函數myFunction，傳入一個參數n。此函數可以計算出1╳2╳3╳…╳n的總和。函數能傳回後的總和。（必須用for迴圈完成）
```python=
# 第一題
def myFunction(n):  # 定義一個函數，將其命名為myFunction
  total = 1  # 給定一個變數total，其初始值為1
  for i in range(1, n+1):  # 使用for迴圈，其範圍從1至n+1，因range不含尾端數字故須填n+1
    total *= i  # total = total * i, 跑第一次迴圈時 total = 1 * 1 = 1, 跑第二次迴圈時 total = 1 * 2 = 2, 跑第三次迴圈時 total = 2 * 3 = 6 ...以此類推
  return total  # 回傳 total

print(myFunction(10))  # 舉例從 1 * 2 * 3 * ... * 10
```
2.請定義一個函數myFunction。此函數可以列出1到9的乘法表，列出的方式如下所示：（必須用for迴圈完成）

乘法1 11=1 12=3 … 1*9=9

乘法2 21=2 22=4 … 2*9=18

乘法3 …

乘法9 91=9 92=18 … 9*9=81
```python=
# define function
def myFunction(n):
  # nested loop,doing every n*n layers  
  for i in range(n): 
    for j in range(n): 
      print(i+1,"x",j+1,"=",(i+1)*(j+1)) # beware the starting of i and j,add 1 in addition

myFunction(9)   #n=9,代入,即為九九乘法表,意同,代入n即可得n*n乘法表
```
3.在老師上課分享的資料匣中，有一個全國路名的檔案「opendata110road.csv」https://drive.google.com/drive/folders/1-5L9l1TrMlBy1_yLiX5k61sCezitNY0g?usp=sharing

3.1.請針對這個檔案，用迴圈找出全國的「中山路」？ 3.2.請針對這個檔案，用迴圈算出全國的「中山路」的數目？ 3.3.請針對這個檔案，用迴圈與判斷式找出高雄市有幾個區，並將每個區只能印出來一次，區不可重複？
```python=
import pandas as pd
data = pd.read_csv('/content/drive/MyDrive/data/opendata110road.csv')#讀取csv檔，並命名為data(請放入自己雲端上該檔案的路徑)

#============方法2
#3.1
count = 0
for i in range(len(data)): #使用迴圈，0~data共有幾筆
  if '中山路' in data['road'][i]: #找尋data['road']為中山路的資料
    print(f"{data['city'][i]} {data['site_id'][i]} {data['road'][i]}") #找到後，輸出該列所有資料
    count += 1 #計算遇到幾個中山路

#3.2
print("=================3.2")
print(f"一共有 {count} 條中山路")


site_id = [] #生成一個list，命名為site_id
#3.3
for i in range(len(data)):
  if data['city'][i] == '高雄市':#找尋data['city']為高雄市的資料
    if data['site_id'][i] not in site_id: #判斷site_id 內是否有 data['site_id][i] 的資料，如果沒有
      site_id.append(data['site_id'][i]) #將資料寫入site_id
print("====================3.3")
print(site_id)
print(f"高雄市共有 {len(site_id)} 個區") #因為site_id資料型態為list，所以可以用len()方法來找尋共有幾個區
```
4.請定義一個函數myFunction，傳入一個參數n。此函數可以找出所有除數，這些除數除以n能夠整除，並將這些因數印出到螢幕上。例如：假設你傳入參數10，函數印出 1,2,5,10。列印時從1印出。(必須用for迴圈與判斷式完成）
```python=
def myFunction(n) : # 定義一個函數 myFunction，傳入一個參數 n
    for i in range(1,n+1) : # for loop 使小於等於 n 的所有值輪流當除數
        if(n % i == 0) : # 若 n 除 i 的餘數為零，則表示 i 是 n 的因數
            print(i, end=' ') # 列印不換行
myFunction(int(input())) # 呼叫 myFunction 並將 input 值作為參數傳入
```
5.請定義一個函數myFunction，傳入一個參數n。此函數可以找出所有除數，這些除數除以n不能夠整除，並將這些因數印出到螢幕上。例如：假設你傳入參數10，函數印出 3,4,6,7,8,9。除數要小於n(必須用for迴圈與判斷式完成
```python=
def myfunction(n):
    for i in range(1,n):
        if(n%i!=0):
            print(i)
myfunction(100)  
```
6.在老師上課分享的資料匣中，有一個「身高體重.xlsx」 請用散佈圖畫出5個人的資料。x軸為身高，y軸為體重。
```python=
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_excel('/content/drive/MyDrive/EXAM/身高體重.xlsx')
x=[]
y=[]
for i in range(0,df["身高"].count()):
  x.append(df.at[i,"身高"])
  y.append(df.at[i,"體重"])
plt.scatter(x,y,s=5)
plt.axis('square')
plt.xlim(150,200)
plt.ylim(40,100)
plt.show()

import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_excel('/content/drive/MyDrive/EXAM/身高體重.xlsx')
plt.scatter(df["身高"],df["體重"])
plt.show() 
```

![](https://i.imgur.com/96lr3od.png)
