fork download
  1. s1 = 'Foo'
  2. s2 = 'Boo'
  3. s3 = 'Foo'
  4. s4 = 'Duh'
  5. s = "We have a collection of types {}."
  6. lst = [s1,s2,s3,s4]
  7. fin = []
  8. for x in lst:
  9. if x not in fin:
  10. fin.append(x)
  11. print(s.format(", ".join(fin)))
Success #stdin #stdout 0s 9024KB
stdin
Standard input is empty
stdout
We have a collection of types Foo, Boo, Duh.