def homeScreenArt():
print("-*----------*------------*------*------*-")
print("-----*-------------*--------------*------")
print("-----&&&&&--&&--&&----&&----&&&&&--------")
print("-*--&&---&&---&&--&&-*--&&---*--&----*---")
print("-----&&&--&&----&&--&&----&&----&--------")
print("-------&&&&&&-*----&&&&--*--&&--&&&&&----")
print("----*-------&&--------*----------*-----*-")
print("-------------&&--&--------*--------------")
print("--*------------&-&--*--------*-------*---")
print("----------*-----&-------Jack-Carter-2018-")
print("-----*------------*--------------*-------\n")
def createLogin():
criteriaMet=0
print("\n"*60,"-NEW USER-\n")
firstname=input("input your first name: ")
age=input("input your age: ")
#returns error message when a name with len < 3 is entered
username=(firstname[0]+firstname[1]+firstname[2]+age)
print("your username is",username)
while criteriaMet<1:
passEntered = input("input a password at least 7 characters long: ")
if (len(passEntered))<7:
print("password entered is",7-(len(passEntered))," characters to short")
passEntered=input("input a password at least 7 characters long: ")
print("password entered is",7-(len(passEntered))," characters to short")
else:
criteriaMet=+1
criteriaMet2=0
textFile=open(username, "w+")
textFile.write("username:\n")
textFile.write(username)
textFile.write("\npassword:\n")
textFile.write(passEntered)
print("user details have been saved to '",username,"'")
while criteriaMet2<1:
showCreds=input("Display user credentials? [y/n]")
if showCreds=="y":
criteriaMet2=+1
print(textFile.read())
textFile.close()
print("if functional")
elif showCreds=="n":
criteriaMet2=+1
#quizMenu()
print("elif functional")
else:
print("Input invalid")
print("else functional")
def menu1():
selection1=input("\n1.Login\n2.New user\n\n\n\n\n\n\n>>> ")
if selection1=="1":
login()
elif selection1=="2":
createLogin()
else:
print("\ninvalid command")
menu1()
homeScreenArt()
menu1()
当它询问用户是否想要查看包含其用户特定凭据的文本文件的内容时,一切都可以工作,我已经添加了调用print&#34; x functional&#34;其中x是if,elif或者是否显示这些函数是否正常工作并返回显示其功能的字符串以便所有工作正常但它不会打印文本文件的内容,我已检查过实际上有文字(确实如此)
ps我不会得到任何错误消息只是一个空行然后&#34; x功能&#34;串