---
# System prepended metadata

title: 共筆筆記

---

# 共筆筆記
# 2/14

x=8,y=6,print(x*y)
48
x=8,x%=6,print(x)
2
x=8,y=6,print(x<y)
False
x=8,y=6,print(x>5 and y<9)
True

# 數學題
![](https://i.imgur.com/674Zt20.png)
![](https://i.imgur.com/g161kS4.png)
![](https://i.imgur.com/NuVpamk.png)

import math #匯入math模組
x=math.sqrt(150)*math.sqrt(45)
print(x)
82.15838362577492

import math #匯入math模組
x=math.sqrt(36/7)/math.sqrt(7)
print(x)
0.8571428571428571

import math #匯入math模組
x=math.sqrt(10)/math.sqrt(2/7)
print(x)
5.916079783099616

x=10**9
y=9**10
print(x>y)
False

x=10**12
y=12**10
print(x<y)
False

x=10**11
y=11**10
print(x>y)
True

x=8*-32*25/-32
print(x)
200.0

a=144837/627
print(a)
print(627*(-199+232+198))
231.0
144837

# 3/7
print("ok")
ok

70*45
3150

60/4
15.0

x=9
y=4
x *= 3
print(x)
27

x=8
y=6
print(x>5 and y<9)
true

x=min(5,10,8,2,25)
y=max(5,10,25)
print(x)
print(y)
2
25

a=(7**0.5-5**0.5)/(7**0.5+5**0.5)
print(a**3+1/a**3)
1692.0000000000002

if 5 > 2:
  print("Five is greater than two!")
five is greater than two!

x=5
y=3
print(type(x))
print(type(y))
x*y
<class 'int'>
<class 'int'>
15

#This is a comment
print("嗨")
嗨

x = 5
y = "John"
print(type(x))
print(type(y))
<class 'int'>
<class 'str'>

x, y, z = "Orange", "Banana", "Cherry"
print(x)
print(y)
print(z)
Orange
Banana
Cherry

fruits = ["apple", "banana", "cherry"]
x, y, z = fruits
print(x)
print(y)
print(z)
apple
banana
cherry

x = "awesome"
print("Python is " + x)
Python is awesome

a=input("Enter a age")
b=input("Enter b age")
a=int(a)
b=int(b)
print(a+b)
Enter a age10
Enter b age12
22

fruit=['watermelon','apple','strawberry','banana','grape','pineapple']
print(type(fruit))
<class 'list'>

thislist = ["apple", "banana", "cherry"]
print(thislist)
['apple', 'banana', 'cherry']

list1 = ["apple", "banana", "cherry"]
list2 = [1, 5, 7, 9, 3]
list3 = [True, False, False]
print(list1)
['apple', 'banana', 'cherry']

# 3/14
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]
print(len(lst))
print(max(lst))
print(min(lst))
lst.sort()
print(lst)

1000
99952
66

# 3/14
lst=['a','b','c','d','e']
lst[2]='x'
lst.append('c')
lst.append('c')
lst.remove('b')
print(lst)
lst.sort
print(lst.count('c'))
['a', 'x', 'd', 'e', 'c', 'c']
2

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

lst=['a','b','c','d','e','f']
#真對lst中的每一個元素i(也就是說我們用i代表每一個元素)
#loop
#走訪串列的每個元素

for i in lst:
  print(i)
a
b
c
d
e

a=[1,2,3,4,5]
for x in a:
  print('in for loop')
  if x>3 :
    print(x)
in for loop
in for loop
in for loop
in for loop
4
in for loop
5

#找出串列lst中大於90000的元素
#換句話說我需要取走走訪串列
#換句話說我需要:針對串列lst的每一個元素x,找出大於90000的元素
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]
for x in lst:
  if 0<x<100000:
    print(x)
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

# 3/21
a=[1,2,3,4,5]
b=0
for x in a:
  print('x=')
  print(x)
  b=b+x
  print('b=')
  print(b)
  print("=======")
print(b)
x=
1
b=
1

x=
2
b=
3

x=
3
b=
6

x=
4
b=
10

x=
5
b=
15



x=[2,4,6,8,10]
for a in x:
  print(a)
2
4
6
8
10

# 3/28
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":"盧承徵",
  "109105031":"簡志安",
  "109105030":"陳柏揚"
}
print(dict["109105030"])
print(len(dict))
print(type(dict))
陳柏揚
92
<class 'dict'>

# 3/28
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":"盧承徵",
  "109105031":"簡志安",
  "109105030":"陳柏揚"
}
for x,y in dict.items():
  if y=="麥禮仁":
   print(x,y)
109213504 麥禮仁

for x,y in dict.items():
  if "陳" in y:
   print (x,y)
110211028 陳宜樺
110251049 陳昱慈
110211005 陳禹侖
110251008 陳韋蓁
110211040 陳亨毓
110251040 陳柔云
110251023 陳懷恩
110211014 陳柏勳
110251003 陳千晴
110251012 陳玟伃
110251005 陳品蓉
110211061 陳柏揚
110251006 陳薏如
110211063 陳玉珊
109105030 陳柏揚

check=[]
for x,y in dict.items():
      if y[0:1] not in check:
        check += y[0:1]
print(len(check))
44
check=[]
for x,y in dict.items():
  if y in check:
    print('有') 
  check +=y 
  print('沒有')
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有
沒有

# 4/11
with open('/content/drive/MyDrive/___TestData/001.Hello.txt', 'w') as f:
  f.write('Hello Google Drive')

from google.colab import drive
drive.mount('/content/drive')
Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount("/content/drive", force_remount=True).

寫入CSV
with open('/content/drive/MyDrive/___TestData/001_Hello.txt', 'w') as f:
  f.write('Hello Google Drive 戴榮賦')
  
讀取CSV
with open('/content/drive/MyDrive/___TestData/001_Hello.txt', 'r') as f:  
  ss=f.read()
  print(ss)
Hello Google Drive 戴榮賦

刪除檔案
import os
if os.path.exists("/content/drive/MyDrive/___DataSet/001_Hello.txt"):
  os.remove("/content/drive/MyDrive/___DataSet/001_Hello.txt")
  print("檔案已經刪除")
else:
  print("檔案不存在")
檔案不存在

#掛載雲端硬碟
from google.colab import drive
drive.mount('/content/drive')

#顯示雲端硬碟
import os
os.chdir('/content/drive/My Drive/___TestData') 
os.listdir() #確認目錄內容

#顯示雲端硬碟
import os
os.chdir('/content/drive/My Drive/___TestData') 
os.listdir() #確認目錄內容
['EXCEL.EXE', '001_Hello.txt', 'example.txt']

# 期中訂正

1.
x,y=67,80
x,y,z=1,2,3
print(x,y,z)

1 2 3

2.
a="2"
b="2"
print(a+b)

22

3.
y = 10
x = y += 2
print(x)

SyntaxError

4.
for item in (1,2,3,4,5):
    print(item)
    print(item)
print(item)

1
1
2
2
3
3
4
4
5
5
5

5.
bag = {"Doran's Blade","Doran's Blade","Doran's Blade",
       "Berserker's Greaves","Caulfield's Warhammer"}
print(bag)

{"Caulfield's Warhammer", "Doran's Blade", "Berserker's Greaves"}

6.
total = 0
n=10
for i in range(n+1):
  total += i
print(total)

55

7.
list = ["A","B","C","D","E","F",]
print(list[:-1])
print(list[2:4])

['A', 'B', 'C', 'D', 'E']
['C', 'D']

8.
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)

[9, 18, 13, 6]
[9, 13, 18, 6]
[9, 13, 6, 18]
[9, 6, 13, 18]
[6, 9, 13, 18]

[6, 9, 13, 18]

9.
list = [1,2,3,4,5,6,7,8,9]
for i in list:
  for j in list:
    print(i,"x",j,"=",i*j)

1 x 1 = 1
1 x 2 = 2
1 x 3 = 3
1 x 4 = 4
1 x 5 = 5
1 x 6 = 6
1 x 7 = 7
1 x 8 = 8
1 x 9 = 9
2 x 1 = 2
2 x 2 = 4
2 x 3 = 6
2 x 4 = 8
2 x 5 = 10
2 x 6 = 12
2 x 7 = 14
2 x 8 = 16
2 x 9 = 18
3 x 1 = 3
3 x 2 = 6
3 x 3 = 9
3 x 4 = 12
3 x 5 = 15
3 x 6 = 18
3 x 7 = 21
3 x 8 = 24
3 x 9 = 27
4 x 1 = 4
4 x 2 = 8
4 x 3 = 12
4 x 4 = 16
4 x 5 = 20
4 x 6 = 24
4 x 7 = 28
4 x 8 = 32
4 x 9 = 36
5 x 1 = 5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
5 x 6 = 30
5 x 7 = 35
5 x 8 = 40
5 x 9 = 45
6 x 1 = 6
6 x 2 = 12
6 x 3 = 18
6 x 4 = 24
6 x 5 = 30
6 x 6 = 36
6 x 7 = 42
6 x 8 = 48
6 x 9 = 54
7 x 1 = 7
7 x 2 = 14
7 x 3 = 21
7 x 4 = 28
7 x 5 = 35
7 x 6 = 42
7 x 7 = 49
7 x 8 = 56
7 x 9 = 63
8 x 1 = 8
8 x 2 = 16
8 x 3 = 24
8 x 4 = 32
8 x 5 = 40
8 x 6 = 48
8 x 7 = 56
8 x 8 = 64
8 x 9 = 72
9 x 1 = 9
9 x 2 = 18
9 x 3 = 27
9 x 4 = 36
9 x 5 = 45
9 x 6 = 54
9 x 7 = 63
9 x 8 = 72
9 x 9 = 81

10.
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)

4

11.
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])


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])
蘋果
蘋果香蕉
香蕉
香蕉葡萄
葡萄
蘋果葡萄

12.
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])

   姓名  國文  數學  英文
0  小明  71  92  68
1  小美  80  15  99
2  小花  58  66  63
3  小華  59  70  72
4  小文  44  68  87

   姓名  國文  數學
0  小明  71  92
2  小花  58  66

   姓名  英文
3  小華  77

   姓名  國文  數學  英文
2  小花  58  66  63
3  小華  59  70  77
4  小文  44  68  87

13.
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)


{'香煎培根堡': 35, '鮮蔬起士堡': 40, '花生培根山明治': 60, '花生燻雞山明治': 65, '洋芋蛋沙拉手捲餅': 45, '香草豬排手捲餅': 55}

60

香煎培根堡
鮮蔬起士堡
花生培根山明治
花生燻雞山明治
洋芋蛋沙拉手捲餅
香草豬排手捲餅

{'香煎培根堡': 40, '鮮蔬起士堡': 45, '花生培根山明治': 65, '花生燻雞山明治': 70, '洋芋蛋沙拉手捲餅': 50, '香草豬排手捲餅': 60}

14.
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}入職")
  
 #5
bag = {"Doran's Blade","Doran's Blade","Doran's Blade",
       "Greaves","Warhammer"}
print(bag)


15.
{'001': '王重陽', '002': '張三丰', '003': '謝遜', '004': '謝安', '005': '李世民', '006': '謝靈運'}

003 謝遜
004 謝安
006 謝靈運

{'張', '李', '謝', '王'}

歡迎001號員工王重陽入職
歡迎002號員工張三丰入職
歡迎003號員工謝遜入職
歡迎004號員工謝安入職
歡迎005號員工李世民入職
歡迎006號員工謝靈運入職
{'Greaves', 'Warhammer', "Doran's Blade"}


# 加分題
https://colab.research.google.com/drive/1ubhfMfKyGshPDMzjndAg_IoMnXE77YRq?usp=sharing


# 5/16 函數
```
#計算1,2,...,n的總和
n=10
s=0
for i in range(1,n+1):
  s=s+i
print(s)  

55
```
* 定義函數
```
def Sum1toN(n): #宣告一個函數，函數為以下的程式碼
  s=0
  #n=10
  for i in range(1,n+1):
    s=s+i
  return s  #回傳
```
```
Sum1toN(3) #呼叫 #傳入參數

6
```
* 代入參數
1. 
```
def my_function(fname):
  print(fname + " Refsnes")

my_function("Emil")
my_function("Tobias")
my_function("Linus")

Emil Refsnes
Tobias Refsnes
Linus Refsnes
```
2. 
```
def myFun(x,y,z):
  print(x+'您好:'+y + ' ' +z)
  
def myCal(x,y):
  z=x+y
  return z #回傳
```
```
myFun(y='小白',x='早餐吃了沒?',z='記得帶外套')
myCal(3,5)
myCal(y=5,x=3)

早餐吃了沒?您好:小白 記得帶外套
8

```
```
a=myCal(x=10,y=5)
print(a)

15
```
3. 
```
def myFun(a,b,c):
  x=a+b+c
  return x
x=my_Fun('小白','喜歡','小新')

小白喜歡小新
```
