subcores = ["AX43", "JOM10", "BALLS", "AYVOC", "PIZZA", "TITAN"]
cores = ["Fast", "Strong", "Balanced"]
Whole_Item = []
active = 1
add_item_active = 1
item_select = []
core_prompt = ("Select one of them, spell them exactly like it is spelled like." + "\n")
subcores_prompt = ("Select one of the core, spell them exactly like it is spelled like." + "\n")
add_item = ""
#####################
print("trash code below!\nThese are the cores available for you:")
for Cheese in cores:
print("\t" + Cheese)
cheese_select = input(core_prompt)
if cheese_select in cores:
print("Adding in " + cheese_select.title() + ".")
else:
print("This isn't in the list, sorry.")
active = 0
if active == 1:
print("Now for the Sub Cores:")
for Item in subcores:
print("\t" + Item)
item_holder = input(subcores_prompt)
if item_holder in subcores:
item_select.append(item_holder)
else:
print("This isn't an item, sorry.")
active = 0
if add_item_active == 1:
add_item = input("Would you like to add more items? If so, enter Yes. \n")
while add_item == "Yes" or "yes":
add_item_active = 0
extra = input("Please select another sub core.\n")
if extra in subcores:
print(extra + " has been added!")
item_select.append(extra)
#checks again... if add_item is no or No, go to the if statement below. If Yes or yes, while loop still goes on
add_item = input("Would you like to continue adding more items?.\n")
if add_item == "No" or "no":
print("This is your finalized core thingy:")
item_select.append(cheese_select)
Whole_Item = item_select[:]
for whole in Whole_Item:
print("\t" + whole)
So I had to do a project for a python book and I made this. The last comment above should tie in with my current problem.
Even if I type in No or No, the while loop still goes on even though it should stop since it requires add_item to be "Yes" or "yes".
(also, do if statements only run once?)