【发布时间】:2021-12-29 07:30:19
【问题描述】:
python中有一个列表l1 =['the movie is',['good','bad'],'and it was',['nice','not bad']]
所以我想要输出:
Output:
the movie is good and it was nice
the movie is good and it was not bad
the movie is bad and it was nice
the movie is bad and it was not bad
我该怎么做?
【问题讨论】:
-
似乎是存储此类数据的不好方法,但它应该是可行的。字符串中的项目数是固定的还是固定的?
-
包含您尝试过的内容,看看我们是否可以改进它
-
我建议使用不同类型的结构...可能是包含主字符串和变体的字典列表?
标签: python string algorithm substring