# Python TQC考題108座標距離計算
x1=eval(input()) #2
y1=eval(input()) #1
x2=eval(input()) #5.5
y2=eval(input()) #8
dist=((x1-x2)**2+(y1-y2)**2)**0.5
import math #第二種作法
dist1=math.sqrt((x1-x2)**2+(y1-y2)**2)
# math.pow()可以做2次方,但**比較簡短
print(“( {:} , {:} )”.format(x1,y1))
print(“( {:} , {:} )”.format(x2,y2))
print(“Distance = {:.4f}”.format(dist))
print(dist1)
#第二種作法,只確認答案一樣,格式要再設定好


#tuple確實跟題目要的座標樣式很像
#可惜x1, x2的前後少了空白

#這一題基本上沒有難度
#就是考空白的位置是否正確







![一文搞懂Python pandas.DataFrame去重:df.drop_duplicates() 與 df[~df.duplicated()] 的等價、差異與最佳實踐 一文搞懂Python pandas.DataFrame去重:df.drop_duplicates() 與 df[~df.duplicated()] 的等價、差異與最佳實踐](https://i1.wp.com/savingking.com.tw/wp-content/uploads/2025/08/20250808202701_0_66f9bc.png?quality=90&zoom=2&ssl=1&resize=350%2C233)



近期留言