1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| x = [ len(mot) for mot in 'mer soleil sable'.split() ]
print "x = [ len(mot) for mot in 'mer soleil sable'.split() ]"
print '==> x est',x,' type(x) est',type(x)
print 'ET tuple(x) est',tuple(x),' type(tuple(x)) est',type(tuple(x))
y = [ len(mot) for mot in 'mer'.split() ]
print "\n\ny = [ len(mot) for mot in 'mer'.split() ]"
print '==> y est',y,' type(y) est',type(y)
print 'ET tuple(y) est',tuple(y),' type(tuple(y)) est',type(tuple(y))
z = [ len(mot) for mot in ''.split() ]
print "\n\nz = [ len(mot) for mot in ''.split() ]"
print '==> z est',z,' type(z) est',type(z)
print 'ET tuple(z) est',tuple(z),' type(tuple(z)) est',type(tuple(z)) |
Partager