Python - 22

Python - 22: Reading & Writing Files

Python can create and read files. In the browser version, we'll simulate files using variables.

✦ Python Editor
▶ Output

👀 Show Example Solution
tasks = ""

tasks = tasks + "Finish homework\\n"

tasks = tasks + "Practice coding\\n"

tasks = tasks + "Play games\\n"

print(tasks)

items = tasks.split("\\n")

for item in items:

    if item != "":
        print("Task:")
        print(item)