Skip to content

Instantly share code, notes, and snippets.

@buddylindsey
Created December 29, 2011 19:07
Show Gist options
  • Save buddylindsey/1535678 to your computer and use it in GitHub Desktop.
Save buddylindsey/1535678 to your computer and use it in GitHub Desktop.
from random import shuffle
print "============================================================================="
print "|| ||"
print "|| Welcome To Expert Travel System ||"
print "|| ||"
print "============================================================================="
a = list(["Damai Beach", "Lundu Beach", "Desaru Beach", "Sapi Island"])
b = list(["","","","","","","","","",""])
c = list(["","","","","","","","","",""])
comma = ","
name = raw_input ("What is your name? ")
print "Hey " + name + "!!! Expert Travel System welcomes you!!!"
print "Please allow us to register your name so that you can continue to use the system"
register = raw_input("Do you want to register? Y/N ")
if register == "Y":
print "You have registered with our system."
print "============================================================================="
print "|| General list of designated travel spot: ||"
print "|| 1. Islands and Beaches ||"
print "|| 2. Adventurous Trips ||"
print "|| 3. Cultural Visits ||"
print "|| 4. City Excitement ||"
print "============================================================================="
spot = raw_input("Please input the number of your desire location: ")
if spot == "1":
print "You have chose Islands and Beaches"
#tourist = raw_input("Please put in the number of travellers: ")
budget = raw_input("Please insert your estimated budget for one person: RM ")
if budget < "2000" and budget > "1000":
#print "total= " + budget * tourist
print "The generated locations are : " + comma.join(a)
#print "Type 1 for Damai Beach"
#print "Type 2 for Lundu Beach"
#print "Type 3 for Desaru Beach"
#location = raw_input("Choose the number of your desire location: ")
#if location == "1":
# chalet = raw_input("Choose 1 for Chalet:")
# hotel = raw_input("Choose 2 for hotel:")
#else:
# location = raw_input("Choose 2 for Lundu")
# location = raw_input("Choose 3 for Rainforest Beach Resort")
# print "You've input the wrong answer"
elif budget == "2000":
print "The generated locations are : Damai, Lundu, Rainforest Beach Resort"
elif budget > "2000":
print "The generated locations are : Damai, Lundu, Rainforest Beach Resort"
else:
print "Sorry we cannot get you any suitable travel location."
elif spot == "2":
print "You have chose Adventurous Trip"
budget = raw_input("Please insert your budget for one person: RM ")
if budget < "2000" and budget > "1000":
print "The generated locations are : "
print random.shuffle(a) + comma.join(a)
print "Type 1 for Bako National Park"
print "Type 2 for Endau-Rompin National Park"
print "Type 3 for Gua Mulu National Park"
elif spot == "3":
print "You have chose Cultural Visit"
budget = raw_input("Please insert your budget for one person: RM ")
if budget < "2000" and budget > "1000":
print "The generated locations are : "
print comma.join(a)
print "Type 1 for Batu Caves"
print "Type 2 for Cultural Village Sarawak"
print "Type 3 for Sam Poh Tong Temple"
elif spot == "4":
print "You have chose City Excitement"
budget = raw_input("Please insert your budget for one person: RM ")
if budget < "2000" and budget > "1000":
print "The generated locations are :"
print comma.join(a)
print "Type 1 for Damai Beach"
print "Type 2 for Lundu Beach"
print "Type 3 for Desaru Beach"
elif budget == "2000":
print "The generated locations are:"
else:
print "Your selection does not match our database"
elif register == "y":
print "You have registered"
else:
print "You have not register so you are not allow to use the system."
#########################
Test code:
>>> a = list([1,2,3,4,5,6])
>>> from random import shuffle
>>> shuffle(a)
>>> print(a);
[4, 5, 6, 3, 1, 2]
>>> b = list(["John", "bill", "frank", "jake", "bob"])
>>> shuffle(b)
>>> print(b)
['John', 'jake', 'bob', 'bill', 'frank']
>>> c = b[:2]
>>> print c
['John', 'jake']
>>> f = shuffle(b)
>>> print f
None
>>> print(f)
None
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment