檔案讀寫

# 寫入檔案
with open("test.txt", "w") as f:
    f.write("Hello, World!")

# 讀取檔案
with open("test.txt", "r") as f:
    content = f.read()
💻 程式碼編輯器
📤 執行結果
等待執行...
下一課 →