Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两个数字的元组,
例如:data = (0.25, 0.25)
data = (0.25, 0.25)
我希望将其转换为这样的字符串:
025and025
没有“。”。
In [55]: data = (0.25, 0.25) In [56]: 'and'.join([str(item).replace('.','') for item in data]) Out[56]: '025and025'