-
Notifications
You must be signed in to change notification settings - Fork 0
/
20210420.txt
249 lines (183 loc) · 6.86 KB
/
20210420.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
'''
c=input("請輸入:")
d=int(c)*10
print(d)
'''
c=eval(input("請輸入:"))
d=c*10
print(d)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
s=input("請輸入:")
score=int(s)
print(score)
if score>=60:
print("及格囉!")
else:
print("等重考吧!")
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
s=input("請輸入:")
num=int(s)
print(num)
if num>=100:
print("三位數以上!")
else:
if num>=10 and num<100:
print("二位數!")
else:
print("個位數!")
s=input("請輸入:")
num=int(s)
print(num)
if num>=100:
if num>=1000:
print("四位數以上!")
else:
print("三位數!")
else:
if num>=10 and num<100:
print("二位數!")
else:
if num<0:
print("負數!")
else:
print("個位數!")
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
a=round(56.789,2)
b=round(56.789)
c=round(56.789,-1)
print(a)
print(b)
print(c)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
s=input("請輸入:")
score=int(s)
print(score)
if score>=90:
print("甲等")
elif score>=80 and score<90:
print("乙等")
elif score>=70 and score<80:
print("丙等")
elif score>=60:
print("丁等")
else:
print("戊等")
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
for i in range(1,11):
print(i)
for i in range(1,20,2):
print(i)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
LL=[1,11,21,31,41]
for i in LL:
print(i)
LL.append(51)
LL.remove(31)
for i in LL:
print(i)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
total=0
total_even=0
total_odd=0
for i in range(450,1601):
total+=i
if(i%2==0):
total_even+=i
else:
total_odd+=i
print("總和:"+str(total))
print("奇數和:"+str(total_odd))
print("偶數和:"+str(total_even))
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
i=1
while i<=10:
print(str(i)+". 石門水庫")
i+=1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
total=0
total_even=0
total_odd=0
a=450
while a<=1600:
total+=a
if(a%2==0):
total_even+=a
else:
total_odd+=a
a+=1
print("總和:"+str(total))
print("奇數和:"+str(total_odd))
print("偶數和:"+str(total_even))
-----------------------
total=1
count=0
while total<=2000000000:
count+=1
total=3**count
print("3的 "+str(count)+" 次方的值:"+str(total))
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'''
for i in range(1,43):
print(str(i)+". 石門水庫")
if i==20:
break
'''
for i in range(1,43):
if i%4==0:
continue
print(str(i)+". 石門水庫")
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
result=""
for i in range(1,43):
if i%4==0:
continue
result+=str(i)+". 巨匠電腦"+"\r\n"
print(result)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
a="巨匠電腦桃園認證中心"
SubString(a,4) 桃園認證中心
SubString(a,4,2) 桃園 C#
SubString(a,4,6) 桃園 Java
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
result=""
a="石門水庫"
for b in a:
result+=b+"\r\n"
print(result)
print(a[2])
print(a[5])
print(a[4:6])
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
result=""
for i in range(1,6):
result+="這是外圈的第 "+ str(i)+" 圈\r\n"
for j in range(1,6):
result += " 這是裡圈的第 " + str(j) + " 圈\r\n"
print(result)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
a=123
b=56.42
print("A的值:{0}, B的值:{1}, 再一次A的值:{0}".format(a,b))
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
result=""
for i in range(1,10):
for j in range(1,10):
result += "{0}*{1}={2}\t".format(i,j,i*j)
result+="\r\n"
print(result)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
result=""
isStop=False
for i in range(1,10):
for j in range(1,10):
result += "{0}*{1}={2}\t".format(i,j,i*j)
if i==6 and j==7:
isStop=True
break
if isStop:
break
result+="\r\n"
print(result)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------