Skip to main content

An Alcoholic Python Program! My friends' first step in Python programming XD

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"


Comments

Popular posts from this blog

Kotlin :A New Beginning

Hello guys, You might have heard about a new language supported for the android Officially by Google,Named as Kotlin. Kotlin is a statically typed Programming language.By statically typed language i mean that the type checking is done during complile time. It was developed in July 2011 by Jetbrains in Russia,In 2017 Google declared Kotlin as the official langauge for android. However the Traditional Java developers are sticking to java. New programmers who want to make android apps,Web apps can use Kotlin as a language of preference. With this Post i welcome you to the world of Kotlin. There is no good book for kotlin but there is the official documentation on Kotlin.I refer the official Kotlin documentation. The main aim of this post if to Introduce you Kotlin and its Uses and also how to write programs in Kotlin. The official documentation can be found on the website   KOTLIN I belive that this post will help you to write codes in Kotlin. So lets begin Fir...

Web programming part 2

Hello guys, I am back with another post on web programming. In the last post you guys had learnt how to create a simple HTML document. As i told you there are many tags that you might have to remember. In this Post i will be creating a small Login form using only HTML. By using only HTML i mean No styling will be given to the document. The purpose of this code is to demonstrate you tags like <form> and <label> you will also learn how to make a button in HTML. The code goes like this: < form  action ="/action_page.php" >      < label > < b > Username < /b > < /label >      < input  type ="text"  placeholder ="Enter Username" >      < label > < b > Password < /b > < /label >      < input  type ="password"  placeholder ="Enter Password" >      < button  type ="submit" ...

Using Java and Python simultaneously

Hi friends,                                                                                                                                    Firstly, I would like to thank you all for your love and support towards our blog.                   We here are happy to know that our previous posts on tutorials and mini projects have helped you a great deal.         So far many of you might have done some really amazing projects using a particular programming language. But in this post of mine, I would like to share with you my mini project for which I have collaborated two of the most am...