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

  • 相关阅读:
    VUE项目开发流程
    vue-导入element-ui
    微信小程序开发-踩坑
    python-编码问题
    python-导入自定义模块
    maven安装配置
    npm修改源
    gitlab使用指南
    Wox使用指南
    Linux拷贝文件夹
  • 原文地址:https://www.cnblogs.com/Shareishappy/p/7011495.html
Copyright © 2011-2022 走看看