This commit is contained in:
Du YuanChao 2019-10-08 16:24:01 +08:00 committed by Christian Clauss
parent 0da4d0a7f3
commit f0568d642e

View File

@ -10,11 +10,7 @@ def abs_val(num):
>>abs_val(0)
0
"""
if num < 0:
return -num
# Returns if number is not < 0
return num
return -num if num < 0 else num
def main():