Latest web development tutorials

Python includes exercises 33

Python 100 Li Python 100 Li

Title: Press the comma-separated list.

Program Analysis: None.

Source Code:

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

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

The above example output is:

1,2,3,4,5

Python 100 Li Python 100 Li