python判斷奇偶數(shù)代碼 如何用python判斷奇偶數(shù)?
如何用python判斷奇偶數(shù)?讓我們直接編碼:num1=int(input(“please input a number:”)num2=int(input(“please input a number
如何用python判斷奇偶數(shù)?
讓我們直接編碼:
num1=int(input(“please input a number:”)
num2=int(input(“please input a number:”)
如果num1%num2==0:
print(“這沒問題。“”
elif num1%num2!=0:
print(“this is not OK”)
不僅可以判斷奇數(shù)還是偶數(shù),還可以判斷兩個(gè)數(shù)是否可以整除,希望對(duì)您有所幫助。