New course! Every coder should learn Generative AI!
Try a free lesson- 1
Define python function called absolute that takes one parameter and return one absolute value of x ie:|x|=(x if >=0,-x otherwis
2 Answers
0
def abs(num):
if(num>=0):
return num
else:
return -num