【发布时间】:2020-05-25 11:26:38
【问题描述】:
给定一个字符串数组,我想在一次遍历数组时随机插入字符至少一定次数
# Very large array of strings in reality
text = ['some', 'list', 'of', 'strings', 'really', 'long', 'one', 'at', 'that']
characters = ['♥', '♫']
# Guaranteed 2 times for example:
result = ['some', '♫', 'list', 'of', '♥', 'strings', 'really', '♥', 'long', 'one', 'at', '♫', 'that']
【问题讨论】:
标签: python arrays python-3.x string character