在Python中使用循环替换字符串

时间:2018-10-12 01:22:54

标签: python string loops replace

我对Python还是很陌生,在如何循环使用它方面也很困难。

mynewvar2=varlist3.replace('R0','_0').replace('R1','_1').replace('R2','_2').replace('R3','_3').replace('R4','_4').replace('R5','_5').replace('R6','_6').replace('R7','_7').replace('R8','_8').replace('R9','_9')

这里的问题是,如果给我更多的功能,我将添加许多.replace()函数。

非常感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

2018-10-12 08:22:20.869093: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-10-12 08:22:22 INFO     root  - Rasa Core server is up and running on http://localhost:5005
Bot loaded. Type a message and press enter (use '/stop' to exit):