除了重複使用Function,有時我們須檢查結果,依此判斷下個步驟該怎麼進行,如此就需要條件式 condition statement。

if ... elif ... ese ( 或 if ... elif ...elif 或 if .. else )

while

>>> def numIsEven(k):
...    if k % 2 == 0:
...       print(k,' is even')
...    else:
...       print(k,' is odd')
...
>>> numIsEven(8)
8  is even
>>> numIsEven(7)
7  is odd

/end

最新文章

  1. docker设置并运行部分命令及原文
  2. ELF Format 笔记(二)—— ELF Header
  3. 全零网络IP地址0.0.0.0表示意义详谈
  4. HelloWorld IL代码
  5. find命令下的atime,ctime,mtime
  6. codeforces 434B B. Nanami's Digital Board(分治)
  7. Excel连接字符串(Oledb)
  8. C#中启动外部应用程序
  9. MCS-51单片机I/O端口的存取
  10. OD调试篇3-小软件破解1
  11. 14.3.5.1 An InnoDB Deadlock Example
  12. dtree实现上下级关系的显示
  13. express学习点滴- 永远不要忘记异步
  14. Java基础之引用(String,char[],Integer)总结
  15. 使用pypi-server搭建简单的PyPI源
  16. CentOS在线安装RabbitMQ3.7
  17. Exp3 免杀原理与实践
  18. jquery打印页面(jquery.jqprint)
  19. [UI] UI things
  20. nvm(Node Version Manager)管理node版本

热门文章

  1. Sunset: Nightfall Vulnhub Walkthrough
  2. deinit 没执行
  3. Redis中几个简单的概念:缓存穿透/击穿/雪崩,别再被吓唬了
  4. springboot 读取 resource 下的文件
  5. WinCC的电子签名与审计追踪
  6. ReactNative: 使用弹出框组件ActionSheetIOS组件
  7. ReactNative: 使用对话框组件AlertIOS组件
  8. java.sql.SQLException: Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.解决方案
  9. 老版本nginx存在安全漏洞,不停服务热升级
  10. drf请求模块分析