The program asks the user for some text and puts it into a text file, adding before this the current date and time. If there is already text in the file, the new one must be added without removing the old one. Entries are separated by a blank line.
What is missing in this code?
from datetime import datetime vremja = str(datetime.today()) tekst = input("Введите запись: ") f = open("dnevnik.txt", "a", encoding="UTF-8") f.write(vremja + "\n") f.write(tekst + "\n") f.write("\n") f.close