Everytime this piece of code is compiled, I expect it to go through each "if,elif" untill it finds a match. So it can continue to print out the given list on the screen.
But to my surprise even if you input "rifles", all it does is give you the "else" statement.
This is my first post on Stackoverflow, so forgive me if I made some mistake.
Any help is very much appreciated, thanks in advance.
rifles = ["Ak47", "M4A1", "Aug", "Famas", "Galil"]
pistols = ["Glock", "USP", "Deagle", "P250", "Five-7", "Tec-9"]
shotguns = ["Buckshot", "Benelli", "M1319", "Sawed-Off"]
snipers = ["AWP", "SSG", "Cheytac", "Barret", "M24"]
grenades = ["Smoke", "High-Explosive", "Flash", "Concussion", "Molotov", "Incendiary"]
knives = ["Bayonette", "Karambit", "Machete", "Butterfly", "Katana"]
equipment = ["Kevlar", "Helmet", "Tactical-Shield", "Boots", "Nightvision"]
raw_input = input("Search: ")
def search():
if raw_input == "Rifles":
for ri in rifles:
print(ri)
break
elif raw_input is "Pistols":
for pi in pistols:
print(pi)
break
elif raw_input is "Shotguns":
for sho in shotguns:
print(sho)
break
elif raw_input is "Snipers":
for sni in snipers:
print(sni)
break
elif raw_input is "Grenades":
for gre in grenades:
print(gre)
break
elif raw_input is "Knives":
for kni in knives:
print(kni)
elif raw_input is "Equipment":
for equ in equipment:
print(equ)
else:
print("Try again...")
return
search()