python - How to insert string into another string with same multiple occurrences -


How can the following syntax be simplified?

  three = 'three' result = 'one-two-% s, one-two-% s, one-two-% s'% (three, three, three))  

Another surprise is: KeyIer: 'border' on:

 < Code> color = '# 262626' style = "Qprogressbar {background color: {PH: s}}". Format (pH = color)  

  & gt; & Gt; & Gt; Three = 'three' & gt; & Gt; & Gt; Results = 'one-two- {pH: s}, one-two- {pH: s}, one-two- {PH: s}'. Format (pH = three)> & gt; & Gt; & Gt; Print result one-two-three, one-two-three, one-two-three  

edit :

  & Gt; ; & Gt; & Gt; Style = "QProgressBar {{background-color: {PH: s}}}". Format (pH = color)> gt; & Gt; & Gt; Print style QProgressBar {background-color: # 262626}  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -