我如何写下以下清单:
[(8, 'rfa'), (8, 'acc-raid'), (7, 'rapidbase'), (7, 'rcts'), (7, 'tve-announce'), (5, 'mysql-im'), (5, 'telnetcpcd'), (5, 'etftp'), (5, 'http-alt')]
到一个有两列(8 rfa)
和许多行的文本文件,这样我就有了这样的东西:
8 rfa
8 acc-raid
7 rapidbase
7 rcts
7 tve-announce
5 mysql-im
5 telnetcpcd
^{} 模块非常强大!
如果要使用str.format(),请将第2行替换为:
相关问题 更多 >
编程相关推荐