Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- str = ">" + "432" * 100 + "<"
- #print(str.replace("4", "!", 1))
- while str.find(">4") or str.find(">3") or str.find(">2") or str.find("4<") or str.find("3<") or str.find("2<"):
- if str.find(">4") or str.find(">3"):
- str = str.replace(">4", "2>3", 1)
- str = str.replace(">3", "1>2", 1)
- else:
- if str.find("4<") or str.find("3<"):
- str = str.replace("4<", "3<2", 1)
- str = str.replace("3<", "2<1", 1)
- else:
- str = str.replace("2>", "0>", 1)
- str = str.replace("2<", "<0", 1)
- print(str)
Add Comment
Please, Sign In to add comment