Advertisement
pacho_the_python

Untitled

Feb 16th, 2022
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. numbers = list(map(int, input().split()))
  2.  
  3. while True:
  4.     command = input().split()
  5.    
  6.     if command[0] == 'end':
  7.         print(', '.join(map(str, numbers)))
  8.         break
  9.        
  10.     elif command[0] == 'decrease':
  11.         numbers = [x - 1 for x in numbers]
  12.        
  13.     elif command[0] == 'swap':
  14.         numbers[int(command[1])], numbers[int(command[2])] = numbers[int(command[2])], numbers[int(command[1])]
  15.        
  16.     elif command[0] == 'multiply':
  17.         numbers[int(command[1])] *= numbers[int(command[2])]
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement