Test 2
user_4388137
python
2 years ago
991 B
6
Indexable
colours = ["red", "blue", "pink", "green"] print(colours) is_True = True while is_True: choice_1 = input("Do you wish to change something? \n Y/N \n") if choice_1 == "Y" or choice_1 == "y": choice_2 = int(input("What would you change? \n 1. Add obj\n 2. Delete obj\n ")) while choice_2 == 1: colours.append(input("Okay let's add an object. Give it a name: ")) print(colours) answer_1 = input("Are we done here? \n Y/N \n") if answer_1 == "Y" or answer_1 == "y": print("Okay then.") break while choice_2 == 2: colours.remove(input("Okay let's remove an object. Enter the name: ")) print(colours) answer_1 = input("Are we done here? \n Y/N \n") if answer_1 == "Y" or answer_1 == "y": print("Okay then.") break else: break print("Okay then. Bye.") print(colours)
Editor is loading...