Codewars notes - Return negative - 正转负

 

 

def make_negative( number ):
    
    if number > 0:
        return number * -1
    else:
        return number
    
make_negative(1)
make_negative(-5)
make_negative(0)

 

posted @ 2022-06-24 15:12  大序列  阅读(5)  评论(0编辑  收藏  举报