Python: Exemplos interessantes: Difference between revisions

From Wiki
Line 8: Line 8:
   
   
  for (style1, col1, style2, col2) in style1_col1_style2_col2:
  for (style1, col1, style2, col2) in style1_col1_style2_col2:
   print('<tr><td class="%s">%s</td><td class="%d">%s</td></tr>', style1, col1, style2, col2)
   print('<tr><td class="%s">%s</td><td class="%s">%s</td></tr>', style1, col1, style2, col2)


= Ver também =
= Ver também =

Revision as of 14:18, 28 December 2017

Example 1

style1_col1_style2_col2 = [
   ('s-green', '95%', 's-red', '8%'),
   ('s-yellow', '85%', 's-yellow', '70%'),
   ('s-green', '95%', 's-good', '95%') 
]

for (style1, col1, style2, col2) in style1_col1_style2_col2:

print('%s%s', style1, col1, style2, col2)

Ver também