fork download
  1. s = 'just ***a*** /string/'
  2.  
  3. a = list(s)
  4.  
  5. for i in range(len(a)-1, 0, -1):
  6. if a[i] == '*' or a[i] == '/':
  7. a[i:i+1:] = []
  8.  
  9. print(a)
  10. print("".join(a))
Success #stdin #stdout 0.02s 9164KB
stdin
Standard input is empty
stdout
['j', 'u', 's', 't', ' ', 'a', ' ', 's', 't', 'r', 'i', 'n', 'g']
just a string