By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,377 Members | 3,038 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,377 IT Pros & Developers. It's quick & easy.

i need to search for an item in a tuple thats in a list

P: 1
package = []
print("a.ENTER A NEW HOLIDAY PACKAGE")
print("b.DISPLAY INVENTORY")
print("c.SEARCH FOR A PACKAGE")
print("d.DELETE A HOLIDAY PACKAGE")
print("e.SHOW ALL HOLIDAY PACKAGES WITH SEASONAL DISCOUNT")
print("f.SHOW ALL HOLIDAY PACKAGE WITH NO DISCOUNT")
print("q.quit")
select = input("enter an option")
while select != "q":
if select == "a":
ID = input("enter A unique ID number")
CITY = input("enter holiday destination (city)")
COUNTRY = input("enter holiday destination(country)")
PEOPLE = input("number of people")
NIGHT = input("number of night")
PRICE = input("price per person")
DISCOUNT=input("enter seasonal discount")
packagetuple = (ID, CITY, COUNTRY, PEOPLE, NIGHT, PRICE, DISCOUNT)
package.append((packagetuple))
print(package)
if select == "b":
if package == []:
print("NO DESTINATION WAS INPUTED")
else:
for word in package:
print(word[1:3])
select =input("enter an option")
if select == "c":
search = input("enter a city")
for word in package:
if search === word[1]:
for word in packagetuple:

else:
if "c" == []:
print("NO PACKAGE FOUND")

if select == "d":
delete =input("delete a holiday package")
for n in package:
if n ['delete']==package:
package.remove(n)
Mar 27 '18 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.