JS Wartość bezwzględna
Math.abs(-4)//returns 4
Math.abs(4)//returns 4
If-dev
Math.abs(-4)//returns 4
Math.abs(4)//returns 4
def max_absolute_value(int1,int2):
return max(abs(int1), abs(int2))
#find the absolute or modulous of the number
a=int(input('enter number'))
if a>0:
print('The absolute value of',a,'is',a)
else:
print('The absolute value of',a,'is',-a)
#output:
#case I
enter number4
The absolute value of 4 is 4
#case II
enter number-4
The absolute value of -4 is 4