#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: 如何對 pandas.DataFrame 兩欄位運算後,增加到最後一欄? df[‘sum_AB’] = df.apply(sum_ab, axis=1) ; lambda函式 Python: 如何對 pandas.DataFrame 兩欄位運算後,增加到最後一欄? df[‘sum_AB’] = df.apply(sum_ab, axis=1) ; lambda函式](https://i1.wp.com/savingking.com.tw/wp-content/uploads/2023/03/20230314200417_4.png?quality=90&zoom=2&ssl=1&resize=350%2C233)


![Python: matplotlib繪圖,如何限定座標軸範圍? plt.axis([xmin, xmax, ymin, ymax]) Python: matplotlib繪圖,如何限定座標軸範圍? plt.axis([xmin, xmax, ymin, ymax])](https://i2.wp.com/savingking.com.tw/wp-content/uploads/2023/02/20230208101745_93.jpg?quality=90&zoom=2&ssl=1&resize=350%2C233)



近期留言