Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The function that determines the number distance from zero
- # And it accept an integer argument either positive or negative
- def negative_energy(value):
- # Using abs function to determine the distance from zero
- absolute = abs(value)
- # Return the absolute value
- return absolute
- # Funtion Invokation
- print(negative_energy(5))
- print(negative_energy(10))
- print(negative_energy(-5))
- print(negative_energy(-8))
- print(negative_energy(0))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement