QUOTE(zartek @ 29 May, 2008 - 12:40 PM)

the last line of code 'print...'
did not work, though the other conversion equation ounce/16 works just find, can you explain the last line of code to me?
Thanks again
Z
It didn't work? That's strange, it worked in the Try Python online interpreter... (I was at school and couldn't test on a PC with
actual Python)
...
Testing my code at home now. The last line is working for me, however
pounds = str(ounces/16) isn't. %s is just another way of printing a string variable instead of doing
print 'Weight is ", pounds, ' lbs'. It says, "Take %s and fill in the variable _____ for that placeholder", with the variable being the one after the % at the end. It works with multiple variables too. For example...
python
var_1 = 'Hello'
var_2 = 'my'
print '%s World, %s name is Andy' % (var_1, var_2)
would print "Hello World, my name is Andy".
Sorry I can't help with that line though, as it works for me. What version of Python are you using?
This post has been edited by .Maleficus.: 29 May, 2008 - 02:46 PM