On 2013-11-29 16:31, farhan...@gmail.com wrote:
> It's for a school assignment.

Thanks for the honesty--you'll get far more helpful & useful replies
because of that. :-)

> put them into a variable I called "number" but it seems to glitch
> out that variable is in any command other than "print number".
> Like, if I try to write:
> 
> print "<p>your total number was:" number "</p>" 
> 
> It just doesn't work. 

You're so close.  Python doesn't let you directly combine strings and
numbers like that, especially without any operator.  However it does
offer several ways to combine strings:

  print "convert to string and use " + str(number) + " a '+' operator"
  print "use %s classic C-style formatting" % number
  print "use new {} formatting style".format(number)

-tkc



-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to