我需要在项目列表中查找字母

时间:2018-08-14 19:47:58

标签: list

list_name = ['shlomi','nir','moshe','david','itzik','yoda','noa','hila','lae','nava']

如果list_name中的x包含“ i” 打印“此名称中包含我”:     其他:         打印x'此名称中不包含i'

1 个答案:

答案 0 :(得分:0)

list_name = ['shlomi','nir','moshe','david','itzik','yoda','noa','hila','lae','nava']

对于列表名称中的项目:     如果(item.find('i'))!= -1:         打印(“找到于”项目)