How to use the abs() function with different types of a numbers in Python

1 Answer

0 votes
f = -98.17
print(abs(f))

i = -187
print(abs(i))

comp = (3 - 4j)
print(abs(comp))


'''
run:

98.17
187
5.0

'''

 



answered Dec 8, 2018 by avibootz
...