python_task/script.py

16 lines
390 B
Python

def convert_case(text):
return text.swapcase()
def main():
with open('data.txt', 'r') as file:
data = file.read()
converted_data = convert_case(data)
with open('output.txt', 'w') as file:
file.write(converted_data)
print("Регистр букв изменён. Результат записан в output.txt")
if __name__ == "__main__":
main()