Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- house=["one", "two","three"]
- capacity=[4, 4,4]
- peak=[200, 200,100]
- offPeak=[50, 60,80]
- capacity=[4,4,4]
- availableOne=[2,3,4,5,6,7,8,9]
- availableTwo=[2,3,4,5,6,7,8,9]
- availableThree=[2,3,4,5,6,7,8,9]
- found=False
- cost=0
- bookingCode=0
- bookingsCode=[]
- bookingsCabin=[]
- while (True):
- choice = input("Enter house choice")
- print("weeks available")
- if choice=="one":
- indMarker=0
- for x in range (len(availableOne)):
- print (availableOne[x])
- chooseWeek=int(input("Choose a week to book"))
- for x in range (len(availableOne)):
- if chooseWeek==availableOne[x] and chooseWeek!=0:
- print ("Week available")
- if chooseWeek>=2 and chooseWeek<=5:
- cost+=peak[indMarker]
- else:
- cost+=offPeak[indMarker]
- availableOne[x]=0
- bookingsCode.append(bookingCode)
- bookingsCabin.append("one")
- found=True
- break
- else:
- found=False
- if found==False:
- print ("Week NOT available")
- if choice=="two":
- indMarker=1
- for x in range (len(availableTwo)):
- print (availableTwo[x])
- chooseWeek=int(input("Choose a week to book"))
- for x in range (len(availableTwo)):
- if chooseWeek==availableTwo[x] and chooseWeek!=0:
- print ("Week available")
- if chooseWeek>=2 and chooseWeek<=5:
- cost+=peak[indMarker]
- else:
- cost+=offPeak[indMarker]
- availableTwo[x]=0
- bookingsCode.append(bookingCode)
- bookingsCabin.append("two")
- found=True
- break
- else:
- found=False
- if found==False:
- print ("Week NOT available")
- if choice=="three":
- indMarker=2
- for x in range (len(availableThree)):
- print (availableThree[x])
- chooseWeek=int(input("Choose a week to book"))
- for x in range (len(availableThree)):
- if chooseWeek==availableThree[x] and chooseWeek!=0:
- print ("Week available")
- if chooseWeek>=2 and chooseWeek<=5:
- cost+=peak[indMarker]
- else:
- cost+=offPeak[indMarker]
- availableThree[x]=0
- bookingsCode.append(bookingCode)
- bookingsCabin.append("three")
- found=True
- break
- else:
- found=False
- if found==False:
- print ("Week NOT available")
- anotherStay=input("Book another stay? N to quit")
- if anotherStay=="N":
- bookingCode+=1
- break
- print("Total Cost is",cost)
- print(bookingsCode)
- print(bookingsCabin)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement