mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-19 00:37:02 +00:00
less code (#1292)
This commit is contained in:
parent
0da4d0a7f3
commit
f0568d642e
|
@ -10,11 +10,7 @@ def abs_val(num):
|
||||||
>>abs_val(0)
|
>>abs_val(0)
|
||||||
0
|
0
|
||||||
"""
|
"""
|
||||||
if num < 0:
|
return -num if num < 0 else num
|
||||||
return -num
|
|
||||||
|
|
||||||
# Returns if number is not < 0
|
|
||||||
return num
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user