#Python TQC考題202_倍數判斷
x=eval(input())
if x%3==0 and x%5==0:
print(“{} is a multiple of 3 and 5.”.format(x))
#沒有要設定格式, { }中的:可加可不加
#加了:也可正常執行
elif x%3==0 and x%5!=0:
print(“{} is a multiple of 3.”.format(x))
elif x%3!=0 and x%5==0:
print(“{} is a multiple of 5.”.format(x))
else:
print(“{} is not a multiple of 3 and 5.”.format(x))

# { }中有加:仍可正常執行:


# n%3 == 0,後面再加 and n%5 != 0
#看似比較嚴謹,但沒加沒出錯


![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://i0.wp.com/savingking.com.tw/wp-content/uploads/2023/02/20230216183536_29.png?quality=90&zoom=2&ssl=1&resize=350%2C233)





![Python struct.pack() 將整數轉換為bytes ; while list: str1=list[0] ; 中間內容; list=[1:] #切片 ,遍歷list中的每一個元素,跟for i in list 類似 ; timeit() #計時 Python struct.pack() 將整數轉換為bytes ; while list: str1=list[0] ; 中間內容; list=[1:] #切片 ,遍歷list中的每一個元素,跟for i in list 類似 ; timeit() #計時](https://i1.wp.com/savingking.com.tw/wp-content/uploads/2022/10/20221012095050_42.png?quality=90&zoom=2&ssl=1&resize=350%2C233)


近期留言