zoukankan      html  css  js  c++  java
  • 过滤(s='good ' if m%2==0 else 'bad') 分类: python 小练习 python基础学习 2013-12-27 13:45 220人阅读 评论(0) 收藏

    #coding:utf-8
    
    
    def main(m):
    
        '''这个方法主要是用于过滤奇偶数,
        如果是偶数,输出good,否则输出bad'''
        
        s='good ' if m%2==0 else 'bad'
        print s
    
    if __name__ == '__main__':
        main(4) # good
        main(5) # bad
    


    版权声明:本文为博主原创文章,未经博主允许不得转载。

  • 相关阅读:
    file
    shell脚本的执行
    添加源,删除源
    lsattr, chattr
    umask
    od
    init
    sync
    wc
    history
  • 原文地址:https://www.cnblogs.com/think1988/p/4627981.html
Copyright © 2011-2022 走看看