日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)Python教程:Python怎么將列表轉(zhuǎn)字符串

python怎么將列表轉(zhuǎn)字符串

例子:

將列表 temp_list = ['h', 'e', 'l', 'l', 'o'] 轉(zhuǎn)換成字符串'hello',代碼如下:

temp_list = ['h', 'e', 'l', 'l', 'o']
result = ''.join(temp_list)
print(result)    

hello

推薦學(xué)習(xí)《Python教程》。

字符串對(duì)象的方法join其描述如下:

大概意思是:s.join(iterable)是將括號(hào)內(nèi)的迭代對(duì)象(如列表)使用s字符串作為鏈接將迭代對(duì)象中的元素拼接成一個(gè)字符串,返回該字符串。

def join(self, iterable): # real signature unknown; restored from __doc__
        """
        S.join(iterable) -> str
        
        Return a string which is the concatenation of the strings in the
        iterable.  The separator between elements is S.
        """
        return ""

分享題目:創(chuàng)新互聯(lián)Python教程:Python怎么將列表轉(zhuǎn)字符串
當(dāng)前鏈接:http://m.5511xx.com/article/dpddijh.html