0
我测试出来的几行代码的string.join()
方法:问题使用的string.join()操作
a = 1
b = 1
c = 0
superpower = []
if a == 1:
superpower.append("flying")
if b == 1:
superpower.append("soaring")
if c == 1:
superpower.append("high")
", ".join(superpower)
print superpower
但结果总是回来的只是一个普通的列表,而不是一个字符串。我怎样才能解决这个问题?我是python的新手,并希望得到帮助。
这很合理,谢谢! –