I'm just making this simple application with python with calculates the lethal amount of caffeinated drinks you can consume according to your
body weight in kilograms.
The code works fine, it's just when it prints out the result in the console, it simply shows the lethal amount of drinks you can take in one go.
I wanted it to be something like this:
print "Your lethal dose is" + limit + "cans"
The problem is that if I do that, python will produce this error:
CODE
print "Your lethal dose is" + limit + "cans"
TypeError: cannot concatenate 'str' and 'int' objects
Here's the code for the complete application:
CODE
#!/usr/bin/python
while 1:
calc=(input("""1)Coke
2)Jolt Cola
3)Red Bull
4)Mountain Dew
5)Exit
Pick Your Poison: """))
out=""
if calc==1:
weight=input("Enter your body weight in kg")
limit = 150 * weight / 34
print limit
break
elif calc==2:
weight=input("Enter your body weight in kg")
limit = 150 * weight / 280
print limit
break
elif calc==3:
weight=input("Enter your body weight in kg")
limit = 150 * weight / 80
print limit
break
elif calc==4:
weight=input("Enter your body weight in kg")
limit = 150 * weight / 54.5
print limit
break
elif calc==5:
print 'Exit'
break
else:
print 'Enter only a number from 1 - 5:'
print