相关疑难解决方法(0)

在Python中打印集时删除集标识符

我正在尝试打印出一组内容,当我这样做时,我在打印输出中得到了set identifier.例如,这是我的输出set(['a', 'c', 'b', 'e', 'd', 'f', 'gg', 'ff', 'jk'])"为下面的代码.我想摆脱这个词set.我的代码非常简单,在下面.

infile = open("P3TestData.txt", "r")
words = set(infile.read().split())
print words
Run Code Online (Sandbox Code Playgroud)

这是我的输出,以便于参考: set(['a', 'c', 'b', 'e', 'd', 'f', 'gg', 'ff', 'jk'])

python set python-2.7

19
推荐指数
1
解决办法
4万
查看次数

标签 统计

python ×1

python-2.7 ×1

set ×1