我刚刚结束我的家事作家方案,现在我确实存在问题。
我这样说,当一项职能完成时,我询问它是否希望重新履行主要职能,而当时,它却履行不同的职能(如果用文字uck忙的话),那么这一职能根本就没有任何作用。 是否有东西可以做?
Here is my code
agenda=open("agenda.txt","a") #open the notepad file
def choice(): #pick the period
choice=input("type write, read, or clear
")
if choice=="read":
read()
elif choice=="write":
write()
elif choice=="clear":
clear()
else:
print("Invalid Choice")
def write(): #write the homework
per=input("What period is it")
hw=input("What is the homework")
if per=="1":
agenda.write("Period 1:")
agenda.write(hw)
agenda.write("
")
elif per=="2":
agenda.write("Period 2:")
agenda.write(hw)
agenda.write("
")
elif per=="3":
agenda.write("Period 3:")
agenda.write(hw)
agenda.write("
")
elif per=="4":
agenda.write("Period 4:")
agenda.write(hw)
agenda.write("
")
elif per=="5":
agenda.write("Period 5:")
agenda.write(hw)
agenda.write("
")
elif per=="6":
agenda.write("Period 6:")
agenda.write(hw)
agenda.write("
")
elif per=="7":
agenda.write("Period 7:")
agenda.write(hw)
agenda.write("
")
elif per=="8":
agenda.write("Period 8:")
agenda.write(hw)
agenda.write("
")
else:
print("Non existant period")
again=input("Would you like to read the homework, clear, or read again? (yes or no)")
if again=="yes":
choice()
elif again=="no":
print("
")
def clear():#clear the whole thing
ajenda = open( agenda.txt , r+ )
ajenda.truncate()
again=input("Would you like to read the homework, clear, or read again? (yes or no)")
if again=="yes":
choice()
elif again=="no":
print("
")
def read():#read the homework
read=open("agenda.txt","r")
readf=read.read()
print(readf)
read.close
again=input("Would you like to read the homework, clear, or read again? (yes or no)")
if again=="yes":
choice()
elif again=="no":
print("
")
choice()
agenda.close()