python - Traceback (most recent call last): How do I get past this in my code? -
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!") time import sleep contact = input("would add contact: y or n?") if contact == "y": 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 see contacts:y or n?") if contact == "y": contactsn() def contactsn(c): contactsn = open("coontactsn.txt", "r") print (contactsn.read()) quit
Comments
Post a Comment