从Python中的另一个字符串中提取字符串
我有两个列表
a = ['Shri Vatsav Ltd','Paytm Pvt ltd','Paypal ltd']
b = ['Shri Vatsav Ltd 123 HAL 2nd Stage Indiranagar Banagalore 560008','Paytm Pvt ltd 143 Jallianwallabagh Mumbai India 34567','Paypal ltd 345 Greenwood drive 123ST Long Beach CA 34566 US']
我只需要使用列表“ a” a“ IE,某种交集或类似的东西提取地址。并将其存储为称为“ C”的列表,
请找到示例输出:
输出
['123 HAL 2nd Stage Indiranagar Banagalore 560008','143 Jallianwallabagh Mumbai India 3456','345 Greenwood drive 123ST Long Beach CA 34566 US']
谢谢。
I have two lists
a = ['Shri Vatsav Ltd','Paytm Pvt ltd','Paypal ltd']
b = ['Shri Vatsav Ltd 123 HAL 2nd Stage Indiranagar Banagalore 560008','Paytm Pvt ltd 143 Jallianwallabagh Mumbai India 34567','Paypal ltd 345 Greenwood drive 123ST Long Beach CA 34566 US']
I need to extract only the address from list "b" using list "a" i.e, some kind of intersection or something like that. and store it as a list called "c"
Please find the example output:
output
['123 HAL 2nd Stage Indiranagar Banagalore 560008','143 Jallianwallabagh Mumbai India 3456','345 Greenwood drive 123ST Long Beach CA 34566 US']
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)