Advertisement
Spocoman

01. Exchange Integers

Jan 20th, 2022
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. a = int(input())
  2. b = int(input())
  3. print(f'Before:\na = {a}\nb = {b}')
  4. x = a
  5. a = b
  6. b = x
  7. print(f'After:\na = {a}\nb = {b}')
  8.  
  9.  
  10. Решение с масив:
  11.  
  12. info = [int(input()), int(input())]
  13. print(f'Before:\na = {info[0]}\nb = {info[1]}')
  14. info.reverse()
  15. print(f'After:\na = {info[0]}\nb = {info[1]}')
  16.  
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement