用 If Else 編寫一個 Python 程序來檢查數字是否能被 5 和 11 整除。
Python 程序檢查數字是否能被 5 和 11 整除
這個 python 程序允許用戶輸入任意整數值。接下來,這個 Python 程序使用 If Else 檢查給定的數字是否可以被 5 和 11 整除。
# Python Program to Check Number is Divisible by 5 and 11
number = int(input(" Please Enter any Positive Integer : "))
if((number % 5 == 0) and (number % 11 == 0)):
print("Given Number {0} is Divisible by 5 and 11".format(number))
else:
print("Given Number {0} is Not Divisible by 5 and 11".format(number))
原創文章,作者:PHSOD,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/325486.html