fork download
  1. # your code goes
  2. a = ['<a1>', '<a2>', '<a3>', '', '<a5>']
  3. b = ['<b1>', '<b2>', '<b3>', '', '<b5>']
  4. txt = '<a1> test <a2> test <a3> test <a4> test <a5>'
  5.  
  6. ab = zip(a, b) # relacionar as duas
  7. for a_val, b_val in ab:
  8. txt = txt.replace(a_val, b_val)
  9.  
  10. print(txt)
Success #stdin #stdout 0.01s 9992KB
stdin
Standard input is empty
stdout
<b1> test <b2> test <b3> test <a4> test <b5>