我有下面的嵌套列表,我想删除之后的所有项目
(包括
).
my_lst = [['John C, CEO & Co-Funder, ABC company','Eric P, CFO, QWE company','My Profile','Herber W, CTO, PPP company'],
['Eli S, AVP, ACV Company', 'My Profile','Brian M, Analyst, LPL company'],
['Diana F, Managing Director, MS company','Alan X, Associate, JPM company','My Profile', 'Jame R, Manager, AL company']]
我试过编码
[[i for i in nested if i != 'My Profile'] for nested in my_lst]
我的个人资料
从每个列表中。
[['John C, CEO & Co-Funder, ABC company','Eric P, CFO, QWE company'],
['Eli S, AVP, ACV Company'],
['Diana F, Managing Director, MS company','Alan X, Associate, JPM company']]
提前谢谢你的帮助!