#Python 3.X 程式語言特訓教材 8-31頁
#8-3
lst=[]
for i in range(1,10):
str1=input()
lst.append(str1)
for k in range(1,10):
if k%3 != 0 :
print(“|”+lst[k-1].ljust(15)+”|”,end=””)
else:
print(“|”+lst[k-1].ljust(15)+”|”)

#8-4
#結尾e的水果才納入list中
lst=[]
while True:
str1=input()
if str1 == “end” : break
if str1.endswith(“e”):lst.append(str1)
print(lst)

#8-5
str1=input()
print(str1[0])
for i in range(len(str1)):
if str1[i].isdigit():
print(str1[i]+”: is a digit.”)
elif str1[i].isalpha() and str1[i].isupper():
print(str1[i]+”: is upper alpha.”)
elif str1[i].isalpha() and str1[i].islower():
print(str1[i]+”: is lower alpha.”)
elif str1[i].isalpha() and str1[i].isspace():
print(str1[i]+”: is a space.”)
else: print(str1[i]+”: is a symbol.”)


![Python: matplotlib繪製出的圖表如何插入背景圖? img = plt.imread(‘background_image.png’) ; ax.imshow(img, extent=[0, 10, -1.2, 1.2], aspect=’auto’, alpha=0.5) Python: matplotlib繪製出的圖表如何插入背景圖? img = plt.imread(‘background_image.png’) ; ax.imshow(img, extent=[0, 10, -1.2, 1.2], aspect=’auto’, alpha=0.5)](https://i2.wp.com/savingking.com.tw/wp-content/uploads/2023/02/20230216183536_29.png?quality=90&zoom=2&ssl=1&resize=350%2C233)








近期留言