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
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')
Comments
Leave a comment