파일 읽기 filename = "sample.txt" # Read the contents of the file with open(filename, "r") as file: contents = file.read() print("Original contents:") print(contents) 파일 쓰기 # Modify the contents of the file contents = contents.upper() # Write the modified contents to the file with open(filename, "w") as file: file.write(contents) # Read the modified contents of the file with open(filename, "r") as f.....