100-033

按逗号分隔列表。
方法一:
1 #! /usr/bin/env python
2 # -*- coding:utf-8 -*-
3 '''
4 按逗号分隔列表。
5 '''
6 L = [1,2,3,4,5]
7 s1 = ','.join(str(n) for n in L)
8 print (L)
9 print (s1)

 

posted @ 2018-04-27 13:30  睡到自然醒的猪  阅读(55)  评论(0)    收藏  举报

iaoexl at outlook dot com, 返回顶部 →友情链接: 信息港 同城信息