查看: 3007|回复: 0

'String' module object has no attribute 'join'

[复制链接]

665

主题

1234

帖子

6678

积分

xdtech

Rank: 5Rank: 5

积分
6678
发表于 2019-5-1 14:33:51 | 显示全部楼层 |阅读模式
You are trying to use the join method from the string module when you should be using it from the str object.
string.join(current_string,"")
that line for example should be
"".join(current_string)
where current_string is an iteratible.
Just a quick example on how the .join method works
", ".join(['a','b','c'])
will give you a str object of the letters a b and c separated by a comma and a space.

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表