[Tutor] print command

Lutz Horn lutz.horn at gmx.de
Mon Mar 21 08:57:48 CET 2005


Hi,

> To clarify:
> 
> print 1
> print 2
> print 3
> 
> I want output to be 
> 
> 123

>>> l = [1, 2 3]
>>> i = int("".join(map(str, l)))
>>> print i, type(i)
123 <type 'int'>

If you don't care about the blanks, you can use

>>> print 1, 2, 3
1 2 3

Lutz

-- 
pub  1024D/6EBDA359 1999-09-20 Lutz Horn <lutz.horn at gmx.de>
438D 31FC 9300 CED0 1CDE  A19D CD0F 9CA2 6EBD A359
http://purl.oclc.org/NET/lutz.horn

DSL Komplett von GMX +++ Supergünstig und stressfrei einsteigen!
AKTION "Kein Einrichtungspreis" nutzen: http://www.gmx.net/de/go/dsl


More information about the Tutor mailing list