zoukankan      html  css  js  c++  java
  • python_50_函数与函数式编程

    import time
    def logger():
        """追加写"""
        time_format='%Y-%m-%d %X'#年-月-日 小时分钟秒
        time_current=time.strftime(time_format)
        with open('uuu.txt','a+') as f:
            f.write('%s end action
    '%time_current)
    
    def fun1():
        """描述函数1功能"""
        print('in the fun1')
        logger()
    def fun2():
        """描述函数2功能"""
        print('in the fun2')
        logger()
    
    fun1()
    fun2()
    """
    使用函数的三大优点:
    1.代码重用
    2.保持一致性
    3.可扩展性
    """
    

      

  • 相关阅读:
    BD String
    1114
    1083
    1084
    1108
    1087
    1145
    1217
    1164
    反射
  • 原文地址:https://www.cnblogs.com/tianqizhi/p/8328543.html
Copyright © 2011-2022 走看看