Question: Issues python program that calculates blood alcohol conent. I don't know what I did wrong This program calculates the Blood Alcohol # Content with the
Issues python program that calculates blood alcohol conent. I don't know what I did wrong
This program calculates the Blood Alcohol # Content with the difference of gender.
# Create main def main(): # Ask the user for their weight weight= input("What is your Body weight in pounds? ")
# Ask user the type of drink. drink= input("What kind of drink was it? 12oz. ([B]eer, 5oz. [W]ine, 1.25oz. [S]hot) ") w=150.0/float(weight) #body weight print 'w is %f'%w if drink=="b" or drink == 'w': q=.04/50 #beer or wine alcohol content else: q = .12/50 # alcohol shot
# Ask for the drinks consumed z=input("How many drink were consumed? ") x=0.025 bac=float(w)*float(q)*float(z)*x print bac main()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
