Latest web development tutorials

Python incluye ejercicios 33

Python 100 Li Python 100 Li

Título: Pulse la lista separada por comas.

Análisis del programa: Ninguno.

Código fuente:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

L = [1,2,3,4,5]
s1 = ','.join(str(n) for n in L)
print s1

La salida del ejemplo anterior es:

1,2,3,4,5

Python 100 Li Python 100 Li