Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
AidanBaird authored May 13, 2022
1 parent fc0ad4a commit 6de2531
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Opposite_number_kyu8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# A function that takes a given number and converts it to the opposite.

def opposite(number):
if number >= 0:
return (0 - number)
elif number < 0:
return number * -1
# number.pop([0])
else:
return "Error"

0 comments on commit 6de2531

Please sign in to comment.