#Python TQC考題102
a=eval(input())
b=eval(input())
c=eval(input())
d=eval(input())
print(“|{:7.2f} {:7.2f}|”.format(a,b))
print(“|{:7.2f} {:7.2f}|”.format(c,d))
print(“|{:<7.2f} {:<7.2f}|”.format(a,b)) #靠左
print(“|{:<7.2f} {:<7.2f}|”.format(c,d)) #靠左
# | 在Enter鍵上方
#需設定小數點下2位
Spyder執行結果:

n1 = eval(input())
n2 = eval(input())
n3 = eval(input())
n4 = eval(input())
print(“|%7.2f %7.2f|” %(n1,n2)) #靠右
print(“|%7.2f %7.2f|” %(n3,n4)) #靠右
print(“|%-7.2f %-7.2f|” %(n1,n2)) #靠左
print(“|%-7.2f %-7.2f|” %(n3,n4)) #靠左

#欄與欄間隔一個空白字元
#%7.2f %7.2f中間多一個空白
#錯這裡的話,檢查不出來








![Python: pandas.DataFrame (df) 的取值: df [單一字串] 或df [list_of_strings] 選取一個或多個columns; df [切片] 或 df [bool_Series] 選取多個rows #bool_Series長度同rows, index也需要同df.index ,可以使用.equals() 確認: df.index.equals(mask.index) Python: pandas.DataFrame (df) 的取值: df [單一字串] 或df [list_of_strings] 選取一個或多個columns; df [切片] 或 df [bool_Series] 選取多個rows #bool_Series長度同rows, index也需要同df.index ,可以使用.equals() 確認: df.index.equals(mask.index)](https://i1.wp.com/savingking.com.tw/wp-content/uploads/2025/04/20250420212553_0_6fb2c3.png?quality=90&zoom=2&ssl=1&resize=350%2C233)
![Python如何串接OpenAI /Claude /Gemini API自動將大量維修紀錄JSON轉自然語言描述(並避免中斷資料遺失)response = client.chat.completions.create() ; reply = response.choices[0].message.content Python如何串接OpenAI /Claude /Gemini API自動將大量維修紀錄JSON轉自然語言描述(並避免中斷資料遺失)response = client.chat.completions.create() ; reply = response.choices[0].message.content](https://i2.wp.com/savingking.com.tw/wp-content/uploads/2025/07/20250716084059_0_c5b368.png?quality=90&zoom=2&ssl=1&resize=350%2C233)

近期留言