# kod iki parçadan oluşuyor. ilk kısım yapılacakları oluşturma, ikinci kısım yapıldı mı diye sorgulanma
# hangisini yapıyorsanız diğer kısmı 3 tırnak arası yaparak geçersiz hale getirin


"""

dosya = open("To_do_list.txt","w")
# w kullanıldı çünkü her gün yeni işler girileceği için dosya sıfırlanmalı
# eğer gün içi yapılacaklar listesine ekleme yapmanız gerekirse w yerine a yazabilirsiniz
say=1 # while döngüsünün durdurulabilmesi için oluşturulan değişken

while say==1:
todo = str(input("Yapılacak iş: ")) #yapılacak iş string formatında input alınıyor
if todo=="x": # input olarak x girilene kadar listeye ekleme yapmanız için while döngüsü devam eder
say==0 # say değeri 1e eşit olmadığı için break ile döngü başına geldiğinde döngü tekrar başlamamış olacak
break
else:
dosya.write(todo) # dosyaya girilen inputu ekler
dosya.write("\n") # yapılacak iş bastırıldıktan sonra alt satıra geçmemizi sağlar

"""

# gün sonu sorgulama (2.kısım) -------------------------------------------------------------------------

dosya = open("To_do_list.txt","r+") # bu sefer dosya hem okunmalı hem de üzerinde değişiklik yapılmalı. o yüzden r+

i=1 # satırlar için değişken. 1. satırdan başlatacak
say=1 # while döngüsünü sonlandırabilmek için oluşturulan değişken

while say==1:
satir=dosya.readlines(i) # i numaralı satırı "satir" değişkenine atıyoruz
if satir==[]: # satırlar liste formatında olduğu için [] içinde gösterilirler. eğer içi boşsa döngüyü bitiriyoruz bu kısımda
break
else: # eğer satır boş değilse satırı bastırıyoruz
print(satir)

didyou = input("Bu işi yaptın mı? ") # işi yapıp yapmadığımızla ilgili input veriyoruz

i += 1 # satırı 1 arttırıyoruz ki döngü başına geldiğinde bir alt satırdan devam etsin

if didyou=="E" or didyou=="e":
print("Aferin la helal\n")


elif didyou=="H" or didyou=="h":
print("Vay oruspy\n")

else: # e veya h harfleri dışında bir değer girdiğimizde döngüyü sonlandırır
break

This post has been viewed 23 times.

The TextSaver is a simple free tech tool to help save bits of text. You can use it to save notes, text messages, archive text messages from an iPhone or Android, save HTML, avoid PDFs, export messages, lists, phone numbers, addresses, really whatever you want. Please note that saved text is not hidden from the public unless you use the password utility. When using a password, the text will only be viewable to those with a password. Use it for fun, use it for war, use it to control the minds of your enemies.

Legal Disclaimer The website https://textsaver.flap.tv/ (hereinafter referred to as "TextSaver") is a platform designed to allow users to store and share bits of text. TextSaver and its owners do not review, approve, endorse, or make any representations about the legality, accuracy, reliability, completeness, or quality of the content posted by its users. The content reflects the views and responsibility of the person or entity that posts it and does not necessarily represent the views of TextSaver. By using TextSaver, you agree that TextSaver, its owners, affiliates, employees, or agents shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with the use of or reliance on any such content available on or through TextSaver. Users are solely responsible for their content, including compliance with intellectual property laws, confidentiality obligations, and applicable local laws. TextSaver expressly disclaims all liability in relation to the content posted by users. If you believe that any content on TextSaver infringes upon your intellectual property rights or is otherwise unlawful, please contact us with detailed information, and we will take appropriate action in accordance with our policies and applicable laws.