Answer to Question #350564 in Python for Kakay

Question #350564

Input names into a list. The user will be asked if he wants to add another name or not in the list

Output:

Enter your name: Jose, Dela Cruz

Jose

Dela Cruz


Add Another name: Yes

Enter your name: Juan, Cruz

Juan

Cruz


Add Another Name: No

Stop the program


1
Expert's answer
2022-06-14T08:42:47-0400
name = input("Enter your name: ").split(", ")
print(name[0])
print(name[1])
a = input("Add Another name (Yes/No): ")
while a == "Yes":
    name = input("Enter your name: ").split(", ")
    print(name[0])
    print(name[1])
    a = input("Add Another name (Yes/No): ")
else:
    print('Stop the program')

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS