Python函数的定义以及if语句的使用

    技术2022-07-12  75

    Python函数的定义以及if语句的使用

    if-else语句:

    def dun(a,b): if a>=b: return a else : return b print dun(2,4)

    结果输出:4

    if-elif-else语句

    def dun(a,b): if a>b: return a elif a==b: return a+b else : return b print dun(3,3)

    结果输出:6

    Processed: 0.018, SQL: 9