Advertisement
ganiyuisholaafeez

Absolute Function

Feb 19th, 2020
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1.  The function that determines the number distance from zero
  2. # And it accept an integer argument either positive or negative
  3. def negative_energy(value):
  4.  
  5. # Using abs function to determine the distance from zero
  6.     absolute = abs(value)
  7.  
  8. # Return the absolute value
  9.     return absolute
  10.  
  11. # Funtion Invokation
  12. print(negative_energy(5))
  13. print(negative_energy(10))
  14. print(negative_energy(-5))
  15. print(negative_energy(-8))
  16. print(negative_energy(0))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement