473,387 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
0 1384

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

Similar topics

9
by: Yomanium Yoth Taripoät II | last post by:
HI, 1) what are the differences between list and tuple? 2) how to concatenate tuple and list? no method, no opérator? 3) im looking the fucking manual, and cant add value in my tuple, when it...
5
by: nephish | last post by:
hey there, i need to be able to get the index for an item in a list. the list is a list of lines read from a text file. like this: file = open("/home/somefile.text", "r") lines =...
5
by: Xah Lee | last post by:
suppose i'm going to have a data structure like this: , , , , .... ] should i use (width,height) or ?
5
by: Joe Fallon | last post by:
I have a list box with 7 text values in it. I have a pair of buttons to Move Up or Move Down the selected item one position. What is the simplest way to code the buttons so the item moves one...
7
by: daniel | last post by:
is there any typical usage that shows their difference? thanks daniel
10
by: tkpmep | last post by:
For any list x, x.index(item) returns the index of the FIRST occurrence of the item in x. Is there a simple way to identify the LAST occurrence of an item in a list? My solution feels complex -...
7
by: GHZ | last post by:
Is this the best way to test every item in a list? def alltrue(f,l): return reduce(bool.__and__,map(f,l)) def onetrue(f,l): return reduce(bool.__or__,map(f,l)) False
15
by: buddhatown | last post by:
Very simple question for all you folks out there. I am total noob with js. I have a list called drawPathList thats just a list of xy coordinates. I use this to construct a drawing on a map. ...
2
by: Steve | last post by:
I am working on a program that works like a check in/check out system. There is a folder on a network drive that stores a bunch of vb programs. This program will check in and check out programs...
1
by: MasterStarr | last post by:
I Have A Music Player I Made Using A Tutorial In Visual basic 2008 And The Play Button For This Player Plays The Songs Fine, But The Problem Is The Code: AxWindowsMediaPlayer1.Ctlcontrols.next() ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.