Latest web development tutorials

Python include esercizi 33

Python 100 Li Python 100 Li

Titolo: Premere il elenco separato da virgole.

Analisi del programma: Nessuno.

Source Code:

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

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

L'output sopra esempio è:

1,2,3,4,5

Python 100 Li Python 100 Li