如何将python列表中的多个变量转换为单个变量?

时间:2018-09-26 17:20:35

标签: python python-3.x list variables

我不确定如何将列表的多个变量作为单个变量进行混搭,例如,如果我从类似以下内容开始:

<anonymousAuthentication>

我如何设法将其作为输出 <system.webServer> <security> <authentication> <anonymousAuthentication enabled="true" /> <windowsAuthentication enabled="true" /> </authentication> </security> </system.webServer>

1 个答案:

答案 0 :(得分:1)

numbers=[1, 2, 3, 4]
newnumber=int(''.join(map(str,numbers))) #1234