问题:如何从列表中删除第一个单词,以添加到名为^{{cd1>}的新列表中,并保留其余的添加到另一个列表^{{cd2>}。
在^{cd2>}中,我将把其余的放进字典中
比如我读文件时,我得到了
^{cd4>}
^{cd5>}
other_list = []
如何获得如下结果
car_list = [Overland, Scripps-Booth, Briggs]
other_list = [1911,OctoAuto, 1913, Bi-Autogo, 1920, and Stratton flyer]
以下是我所拥有的
^{pr2}$我想^{cd7>}
会起作用的,但我得到以下错误。
^{pr3}$^{cd8>}
^{cd9>}
我以为剪接会奏效,但不会有骰子
我试过^{cd10>}但没有打印任何内容
有什么想法吗?我知道文件正在被读取,但我只是不知道该怎么做。
最后,还可以使用regex来分割字符串。在
输出
^{pr2}$我警告您,
other_list
看起来像是不同类型数据的混合体。那通常是不明智的。有了这个免责声明,下面是一个尝试:相关问题 更多 >
编程相关推荐