Advertisement
AlexG2230954

Задание 6

Feb 21st, 2022
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. # ДЗ на 21.02. Задание 6
  2.  
  3. A = input()
  4.  
  5. while ("772" in A) or ("557" in A):
  6.     if "722" in A:
  7.         A = A.replace("722", "57", 1)
  8.        
  9.     else:
  10.         A = A.replace("557", "72")
  11.        
  12. print(A)
  13.  
  14. # В задании      | В Python
  15. # ----------------------------------------
  16. # заменить(a, b) | A = A.replace(a, b, 1)
  17. # нашлось(a)     | a in A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement