fork download
  1. listA = "AAABBBCCC","DDDEEEFFF"
  2. result = map(lambda x: x[:3], listA)
  3. print(*result)
  4. result = [x[:3] for x in listA]
  5. print(result)
Success #stdin #stdout 0.02s 9052KB
stdin
Standard input is empty
stdout
AAA DDD
['AAA', 'DDD']