[Tutor] Printing to Screen

DORSEY_EDMUND_K@LILLY.COM DORSEY_EDMUND_K@LILLY.COM
Wed Jul 30 16:20:02 2003


This is a multipart message in MIME format.
--=_alternative 006F98F605256D73_=
Content-Type: text/plain; charset="us-ascii"

Is there a way to print but not have it do a new line

For instance in java you have print and println in C you have to specify 
the end of line marker.

Whenever I use print in python is puts a newline. 

Do I need to use a different method for printing to the screen? 

For example...

for x in xrange(0, 5):
        print x

would print

0
1
2
3
4


What if I want it to print 

01234

Thanks!
--=_alternative 006F98F605256D73_=
Content-Type: text/html; charset="us-ascii"


<br><font size=2 face="sans-serif">Is there a way to print but not have it do a new line</font>
<br>
<br><font size=2 face="sans-serif">For instance in java you have print and println in C you have to specify the end of line marker.</font>
<br>
<br><font size=2 face="sans-serif">Whenever I use print in python is puts a newline. </font>
<br>
<br><font size=2 face="sans-serif">Do I need to use a different method for printing to the screen? </font>
<br>
<br><font size=2 face="sans-serif">For example...</font>
<br>
<br><font size=2 face="sans-serif">for x in xrange(0, 5):</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; print x</font>
<br>
<br><font size=2 face="sans-serif">would print</font>
<br>
<br><font size=2 face="sans-serif">0</font>
<br><font size=2 face="sans-serif">1</font>
<br><font size=2 face="sans-serif">2</font>
<br><font size=2 face="sans-serif">3</font>
<br><font size=2 face="sans-serif">4</font>
<br>
<br>
<br><font size=2 face="sans-serif">What if I want it to print </font>
<br>
<br><font size=2 face="sans-serif">01234</font>
<br>
<br><font size=2 face="sans-serif">Thanks!</font>
--=_alternative 006F98F605256D73_=--