回溯(最近一次调用最后一次):如何在我的代码中解决这个问题?

时间:2016-02-08 13:48:00

标签: python

def contactsn():
    contactsn = open("Coontactsn.txt", "r")
    print (contactsn.read())
print ("**     **     ***")
print ("**     **     ***")
print ("*********     ***")
print ("**     **     ***")
print ("**     **     ***")
Contacts = [0]
if Contacts == [0]:
    print ("You have no friends!")
    from time import sleep
Contact = input("Would you like to add a contact: Y or N?")
if Contact == "Y":
    for c in range(0,1):
        print (1 - c)
        sleep(1)
    Contact = input("Name:")
    Contacts.append(Contact)
    Contact1 = input ("age:")
    Contacts.append(Contact1)
    Contact2 = input ("Location:")
    Contacts.append(Contact2)
    Contact3 = input ("Phone Number:")
    Contacts.append(Contact3)
    contactsn = open("Coontactsn.txt", "w")
    contactsn.write(Contact)
    contactsn.write(Contact1)
    contactsn.write(Contact2)
    contactsn.write(Contact3)
    print (Contact)
    print (Contact1)
    print (Contact2)
    print (Contact3)
    contactsn.close()

    Contact = input("Would you like to see your Contacts:Y or N?")
    if Contact == "Y":
                     contactsn()

def contactsn(c):
    contactsn = open("Coontactsn.txt", "r")
    print (contactsn.read())
    quit

0 个答案:

没有答案