[Tutor] simple (fnord) newbie question

R. A. griff@netdoor.com
Fri, 08 Sep 2000 17:51:11 -0500


As the following code illustrates, I'm just learning the absolute basics 
at this point, and I'm trying to pin down a minor detail.  The function 
performs a couple of simple math formulas, but my question is about the 
period standing by itself in quotes at the end of a couple of printed 
statements.

The way I have it now, an additional empty character space is printed 
before the "." such that the first statement printed (for example), 

	Variable 'a' equals 1 and variable 'b' equals 100 .

How can I make it read, instead:

	Variable 'a' equals 1 and variable 'b' equals 100.

Here's the function:

>>> def addnum(a, b):
	print "Variable 'a' equals", a, "and variable 'b' equals", b, "."
	while a <= b:
		print b, "minus variable 'a' equals", b - a
		print "Variable 'a' is added to its own value."
		a = a + a
		print "Variable 'a' now equals", a, "."

Thanks in advance,
Rob