Advertisement
repente

Untitled

Oct 30th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. string = input()
  2. array = list(string)
  3. e = 0
  4. while True:
  5. if len(array) == e:
  6. break
  7.  
  8. if array[e] == "A" :
  9. array[e] = array[e].replace("A","B")
  10. e += 1
  11. continue
  12.  
  13. if array[e] == "B":
  14. array[e] = array[e].replace("B","A")
  15. e += 1
  16.  
  17. print("".join(array))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement