Hi folks,
Today
my dear friends Akshay and Chetan have taken their first step towards learning the
Python programming language. This is the program they have written after
learning the language for the whole day.
Let
us appreciate their interest towards learning Python.
They
sure have a fun way of learning things. I hope you like the program!
Thank you!
:)
#Basic
input operation
day = raw_input("What is the day today??\n")
#list declarations
weekday = ['monday','tuesday','wednesday','thursday','friday']
weekend = ['saturday','sunday']
#Implementation of if statements
if day in weekday:
print 'You cannot drink'
exit(0)
elif day in weekend:
print 'You can drink today!!!!!!'
print 'These are the drinks available'
beer = ['kingfisher','miller','budweiser']
whiskey = ['royal stag','ib','antiquity']
rum = ['old monk','kodais']
print "BEER"
#Implementing for loops
for p in beer:
print(p)
print "WHISKEY"
for q in whiskey:
print(q)
print "RUM"
for r in rum:
print(r)
drink = raw_input("Which drink would you like??\n")
if drink in beer:
print 'Get 200rs'
if drink in whiskey:
print 'Get 100rs'
if drink in rum:
print 'Get 80rs'
wine_gate = [beer[0],beer[1],whiskey[0],rum[0]]
london_street = [beer[2],whiskey[1],whiskey[2],rum[1]]
hotel = ["winegate","londonstreet"]
print "Please choose one of the available hotels:\n"
print hotel
hotel2 = raw_input("which hotel?\n")
drink2 = raw_input("which drink?\n")
if hotel2 in hotel and drink2 in wine_gate:
print "success! You got drunk"
else:
print "Drinks not available"
day = raw_input("What is the day today??\n")
#list declarations
weekday = ['monday','tuesday','wednesday','thursday','friday']
weekend = ['saturday','sunday']
#Implementation of if statements
if day in weekday:
print 'You cannot drink'
exit(0)
elif day in weekend:
print 'You can drink today!!!!!!'
print 'These are the drinks available'
beer = ['kingfisher','miller','budweiser']
whiskey = ['royal stag','ib','antiquity']
rum = ['old monk','kodais']
print "BEER"
#Implementing for loops
for p in beer:
print(p)
print "WHISKEY"
for q in whiskey:
print(q)
print "RUM"
for r in rum:
print(r)
drink = raw_input("Which drink would you like??\n")
if drink in beer:
print 'Get 200rs'
if drink in whiskey:
print 'Get 100rs'
if drink in rum:
print 'Get 80rs'
wine_gate = [beer[0],beer[1],whiskey[0],rum[0]]
london_street = [beer[2],whiskey[1],whiskey[2],rum[1]]
hotel = ["winegate","londonstreet"]
print "Please choose one of the available hotels:\n"
print hotel
hotel2 = raw_input("which hotel?\n")
drink2 = raw_input("which drink?\n")
if hotel2 in hotel and drink2 in wine_gate:
print "success! You got drunk"
else:
print "Drinks not available"
Comments
Post a Comment