String concatenation vs. string substitution in Python

前端 未结 9 1640
暖寄归人
暖寄归人 2020-11-29 17:13

In Python, the where and when of using string concatenation versus string substitution eludes me. As the string concatenation has seen large boosts in performance, is this (

9条回答
  •  星月不相逢
    2020-11-29 17:58

    Actually the correct thing to do, in this case (building paths) is to use os.path.join. Not string concatenation or interpolation

提交回复
热议问题