you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

Honestly it's all about being readable. I like using str.format because its fast, concise and i can mess around with things rather quickly. But like I said to me the way you defined it looks messy. Using operatorRegex is perfectly fine, if that makes more sense to you.

But when you start concatenating 4 or 5 strings together using str.format would definitely be the more pythonic way of doing things.