我有以下输出:
datos=['Venta Casas CARRETERA NACIONAL, Nuevo León', 'Publicado el 29 de Abr', 'ABEDUL DE LADERAS', '3 Recámaras', '4.5 Baños', '300m² de Construcción', '300m² de Terreno', '2 Plantas', ' 81-1255-3166', ' Preguntale al vendedor', 'http://zuhausebienesraices.nocnok.com/', "INFOSTATS_ADOAnuncios('5', '30559440');"]
我想为列表中的每个项目分配一个不同的变量,否则它将为0。例如:
recamara= the string from the list that has the word "Recámara"
bano= the string from the list that has the string "Baño"
等等。如果“巴尼奥”一词不在列表中,那么bano= 0
如果您使用的是Python,那么可以使用列表理解来实现这一点
相关问题 更多 >
编程相关推荐