zoukankan      html  css  js  c++  java
  • hausaufgabe--python 18- Defined specific Functions

    000-- Define a function which meets below criteria:

    a- if the last parameter != 5, then get the sum of all the parameters and multiple base=3

    b- if the last parameter ==5, then the base = 5 and mutiple the left parameter's sum.

     

    running result:

     001-- define a function, to look for the data meet : abc = a^3+b^3+c^3

    running result:

    002--define a function to search how many times a sub String show in a target String

    running result:

    003-- functions decument 

    def MyFirstFunction(name):
    '函数文档在函数定义的最开头部分,用不记名字符串表示'
    print('I love python.com!')

    To access the clarification of the functions:

    >>> MyFirstFunction.__doc__

    oder:

    help(MyFirstFunction)

    005--key parameter

    006-- default parameter

  • 相关阅读:
    CentOS7- 配置阿里镜像源
    MySQL学习笔记
    OSI&TCP/IP模型
    加密算法学习
    golang学习笔记
    Redis学习总结整理
    TCP
    HTTP/HTTPS
    HTTP2
    MVCC
  • 原文地址:https://www.cnblogs.com/Shareishappy/p/7011495.html
Copyright © 2011-2022 走看看