mbikinyi brat <mbikinyi_b...@yahoo.com> wrote:

Dear ALL,
I have defined variables as below and when I call them using the print 
function, I have something discontinous as in pink colour. How do I call it so 
that my output should be as in blue
counter=101
miles=1000
name="joe"

print counter
101
print miles
1000
print name
joe
What I want:(Output)

101
1000
joe

Regards,
Henry


I assume you're just asking all the output to come out at the same time. Two ways to do that: 1) put multiple print statements (not print functions, as you're not using Python 3.0) on the line, like
          print counter; print miles; print name

2) Use newlines in a single print statement, to get them onto separate lines.
        print counter, "\n", miles, "\n", name

  3) Write the whole thing in a definition, and call it.

   def  myfun():

counter=101
miles=1000
name="joe"
print counter
print miles
print name

myfun()

(I can't seem to get those funny vertical bars to edit right, so this may not be formatted quite right.)

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to