Advertisement
DiYane

Invert Values

Jul 31st, 2023 (edited)
692
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | Help | 0 0
  1. def opposite_numbers(input_string):
  2.     numbers = list(map(int, input_string.split()))
  3.  
  4.     opposites = [-num for num in numbers]
  5.  
  6.     return opposites
  7.  
  8. if __name__ == "__main__":
  9.     input_string = input()
  10.  
  11.     output_list = opposite_numbers(input_string)
  12.     print(output_list)
  13.  
Tags: python
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement