s = "4" * 123
while '4444' in s or '7777' in s:
if '4444' in s:
s = s.replace('4444', '77')
else:
s = s.replace('7777', '44')
print(s)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
s = "4" * 123
while '4444' in s or '7777' in s:
if '4444' in s:
s = s.replace('4444', '77')
else:
s = s.replace('7777', '44')
print(s)