go zap去除程序名称_适用于Zip,Zap和Zoom游戏的Python程序
go zap去除程序名稱
Write a python program that displays a message as follows for a given number:
編寫一個(gè)python程序,顯示給定數(shù)字的消息如下:
If it is a multiple of three, display "Zip".
如果是三的倍數(shù),則顯示“ Zip” 。
If it is a multiple of five, display "Zap".
如果是5的倍數(shù),則顯示“ Zap” 。
If it is a multiple of both three and five, display "Zoom".
如果它是三和五的倍數(shù),則顯示“ Zoom” 。
If it does not satisfy any of the above given conditions, display "Invalid".
如果不滿足以上任何條件,則顯示“ Invalid” 。
Examples:
例子:
Input:Num = 9Output : ZipInput:Num = 10Output : ZapInput:Num = 15Output : ZoomInput:Num = 19Output: InvalidCode
碼
# Define a function for printing particular messages def display(Num):if Num % 3 == 0 and Num % 5 == 0 :print("Zoom")elif Num % 3 == 0 :print("Zip")elif Num % 5 == 0 :print("Zap")else :print("Invalid")# Main code if __name__ == "__main__" :Num = 9# Function calldisplay(Num)Num = 10display(Num)Num = 15display(Num)Num = 19display(Num)Output
輸出量
Zip Zap Zoom Invalid翻譯自: https://www.includehelp.com/python/program-for-zip-zap-and-zoom-game.aspx
go zap去除程序名稱
總結(jié)
以上是生活随笔為你收集整理的go zap去除程序名称_适用于Zip,Zap和Zoom游戏的Python程序的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 固原治不孕不育最好的医院推荐
- 下一篇: DNF暗属性强化的魔法石有哪些 怎么获得