Define python function called absolute that takes one parameter and return one absolute value of x ie:|x|=(x if >=0,-x otherwis | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
- 1

Define python function called absolute that takes one parameter and return one absolute value of x ie:|x|=(x if >=0,-x otherwis

17th Nov 2020, 8:18 PM
Prerna Keshkar
Prerna Keshkar - avatar
2 Respuestas
17th Nov 2020, 8:21 PM
Letsintegreat
Letsintegreat - avatar
0
def abs(num): if(num>=0): return num else: return -num
17th Nov 2020, 8:33 PM
Sousou
Sousou - avatar