【发布时间】:2020-06-29 04:39:14
【问题描述】:
我知道了:
0.0 angry27.56%
0.0 disgust0.0%
0.0 fear18.75%
0.0 happy14.47%
0.0 sad5.34%
0.0 surprise14.96%
0.0 neutral18.92%
我想要这个:
0.0 angry27.56%, disgust0.0%, fear18.75%, happy14.47%, sad5.34%, surprise14.96%, neutral18.92%
我正在使用此代码:
emotion = ""
for i in range(len(predictions[0])):
emotion = "%s%s%s" % (emotions[i], round(predictions[0][i]*100, 2), '%')
print(str(sec)+ " " + emotion)
【问题讨论】:
标签: python-3.x string printing