Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def bmi_calculator():
- print "Press 1 to use pounds and inches"
- print "Press 2 to use kilograms and meters"
- measuresystem=raw_input()
- print ""
- if measuresystem == "1":
- print "What is your height in inches"
- height = float(raw_input())
- print ""
- print "What is your weight in pounds"
- weight = float(raw_input())
- print ""
- bmi = (weight * 703) / (height**2)
- print 'Your bmi is %.2f' %bmi
- elif measuresystem == "2":
- print "What is your height in meters"
- height = float(raw_input())
- print ""
- print "What is your weight in kilograms"
- weight = float(raw_input())
- print ""
- bmi = (weight / (height**2))
- print 'Your bmi is %.2f' %bmi
- else:
- print "Please choose a valid number"
- if bmi >= 40:
- print "Category: Morbidly Obese"
- elif bmi >=35:
- print "Category: Severely Obese"
- elif bmi >= 30:
- print "Category: Moderately Obese"
- elif bmi >= 25:
- print "Category: Overweight"
- elif bmi >= 18.5:
- print "Category: Normal Weight"
- elif bmi >= 16.1:
- print "Category: Underweight"
- elif bmi >= 15:
- print "Category: Severely Underweight"
- else:
- print "Category: Extremely Underweight"
- rerunbmi()
- def rerunbmi():
- print ""
- print "Would you like to enter in new metrics for a new result?"
- answer1 = raw_input()
- if answer1 == "no":
- print ""
- print "Ok,hope to see you soon!"
- elif answer1 == "yes":
- print ""
- else:
- print "Please answer yes or no"
- rerunbmi()
- bmi_calculator()
- def magic_8ball():
- print "MAGIC 8 BALL SAYS: What is your question?"
- print ""
- question = raw_input()
- answers = ["It is ceartin.","It is decidedly so.","Without a doubt.","Yes,definitly.","You may rely on it.",
- "As I see it,yes.","Most likely.","Outlook good.","Yes","Signs point to yes.",
- "Reply hazy, try again.","Ask again later.","Better not tell you now.","Cannot predict now.","Concentrate and ask again",
- "Don't count on it.","My reply is no.","My sources say no.","Outlook not so good.","Very doubtful."]
- import random
- print random.choice(answers)
- print ""
- rerunball()
- def rerunball():
- print ""
- print "MAGIC 8 BALL SAYS: Do you have another question?"
- answer1 = raw_input()
- if answer1 == "no":
- print "Goodbye Mortal"
- elif answer1 == "yes":
- print ""
- magic_8ball()
- else:
- print "Please anwer yes or no"
- rerunball()
- magic_8ball()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement