diff --git a/basics.py b/basics.py index 2ab166b..5ec9d6e 100644 --- a/basics.py +++ b/basics.py @@ -1,4 +1,6 @@ -with open("files/fruits.txt", "r") as myfile: - content = myfile.read(90) -with open("files/fruits-copy.txt", "w") as myfile: - myfile.write(content) \ No newline at end of file +with open("files/fruits.txt", "a+") as myfile: + myfile.write("\nOkra") + myfile.seek(0) + content = myfile.read() + +print(content) diff --git a/files/fruits.txt b/files/fruits.txt index 9e55d1b..a269cee 100644 --- a/files/fruits.txt +++ b/files/fruits.txt @@ -3,4 +3,5 @@ apple orange mandarin watermelon -pomegranate \ No newline at end of file +pomegranate +Okra \ No newline at end of file