Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- numbers = list(map(int, input().split(' ')))
- while True:
- command = input()
- if command == "end":
- break
- elif command == "decrease":
- for i in range(len(numbers)):
- numbers[i] -= 1
- else:
- command, index1, index2 = command.split(' ')
- index1 = int(index1)
- index2 = int(index2)
- if command == "swap":
- value = numbers[index1]
- numbers[index1] = numbers[index2]
- numbers[index2] = value
- else:
- numbers[index1] *= numbers[index2]
- print(", ".join(map(str, numbers)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement