to make this more time efficient?
def getEntries():
# Complete this function
print("Press 1 to stop entering data:")
ent= []
while True:
number = int(input("Enter telephone number: \n"))
p = input("Enter first name as first initial: \n")
q = input("Enter full surname: \n")
address = input("Enter address: ")
value = (number, q, p, address)
print(value)
enteredval = input("correct? y OR n: \n")
if enteredval == "n":
continue
ent.append(value)
enterval = input("More entries? 0 or 1: \n")
if enterval == "1":
break
return ent
Why do you think it is not time efficient?
Maybe you're asking too many questions to the user?
If the logic need to ask questions for inputs, then the code will follow. The person saying it is not time efficient knows nothing
Обсуждают сегодня