|
pearcalorieconverter.py |
|
# Written by Acheev Bhagat
#Python vs. Ruby
#Python section of function comparison 1
#Calculates the calories per pounds of a pear
#Lines of code(without comments)=6
#Lines of code(including all comments)=12
import math
def calories():
cal_pound=27
weight=input("Enter the weight of your pear(in pounds): ")
calories_pear=cal_pound * weight
print("Your pear contains about %r calories." %(calories_pear))
|
| Just something I wrote when I was bored. Tells you you how many calories you consumed based on how many pears you ate. |