Some directories had a capital in their name [fixed]. Added a recursive factorial algorithm. (#763)
* Renaming directories * Adding a recursive factorial algorithm
This commit is contained in:
18
maths/abs.py
Normal file
18
maths/abs.py
Normal file
@@ -0,0 +1,18 @@
|
||||
def absVal(num):
|
||||
"""
|
||||
Function to fins absolute value of numbers.
|
||||
>>absVal(-5)
|
||||
5
|
||||
>>absVal(0)
|
||||
0
|
||||
"""
|
||||
if num < 0:
|
||||
return -num
|
||||
else:
|
||||
return num
|
||||
|
||||
def main():
|
||||
print(absVal(-34)) # = 34
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user