0
current_choice="-"
computer_parts=[] #Create an empty list

while current_choice!=0:
    if current_choice in "12345":
        print("Adding {}".format(current_choice))
        if current_choice== "1":
            computer_parts.append("Computer")
        elif current_choice== "2":
            computer_parts.append("mouse")
        elif current_choice== "3":
            computer_parts.append('Keyboard')
        elif current_choice== "4":
            computer_parts.append('monitor')
        elif current_choice== "5":
            computer_parts.append('Mouse mat')
    else:
        print("Add from the list below")
        print("1:Computer \n"
                "2: mouse \n"
                "3:Keyboard \n"
                "4:monitor \n"
                "5: Mouse mat \n"
                "0: to finish")
    current_choice=input()
    
    
print(computer_parts)

MegaIng
  • 6,933
  • 1
  • 21
  • 34

0 Answers0