diff --git a/basics.py b/basics.py index e3db141..950f189 100644 --- a/basics.py +++ b/basics.py @@ -1,4 +1,3 @@ -with open("fruits.txt") as myfile: - content = myfile.read() - -print(content) \ No newline at end of file +with open("files/vegetables.txt", "w") as myfile: + myfile.write("Tomato\nCucumber\nOnion") + myfile.write("\nGarlic") \ No newline at end of file diff --git a/fruits.txt b/files/fruits.txt similarity index 100% rename from fruits.txt rename to files/fruits.txt diff --git a/files/vegetables.txt b/files/vegetables.txt new file mode 100644 index 0000000..f91a6ab --- /dev/null +++ b/files/vegetables.txt @@ -0,0 +1,4 @@ +Tomato +Cucumber +Onion +Garlic \ No newline at end of file