在我的一个项目中,我对以下场景感到震惊:
word = 'mixed4d_pre_relu'
word.strip('_pre_relu')
Out[5]: 'mixed4d'
Run Code Online (Sandbox Code Playgroud)
这里的输出符合预期。
但是,当我执行以下操作时:
word = 'mixed4e_pre_relu'
word.strip('_pre_relu')
Out[5]: 'mixed4' # No 'e' here, yyy?
Run Code Online (Sandbox Code Playgroud)
有谁知道这种行为的原因是什么?
python ×1