jfz-2023-s473616/TaskF01/run.py
Pawel Felcyn da203c4b6f f
2024-01-21 21:43:56 +01:00

17 lines
387 B
Python

import re
def swap_case(match):
return match.group().swapcase()
if __name__ == "__main__":
while True:
try:
line = input()
if not line:
break
result = re.sub(r'\b(?=\w*[a-ząćęłńóśźż])(?=\w*[A-ZĄĆĘŁŃÓŚŹŻ])\w+\b', swap_case, line)
print(result)
except EOFError:
break