Latest web development tutorials

Python inclui exercícios 33

Python 100 Li Python 100 Li

Título: Pressione a lista separada por vírgulas.

Análise do Programa: Nenhum.

Source Code:

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

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

O exemplo acima saída é:

1,2,3,4,5

Python 100 Li Python 100 Li