Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name_list = ["Adam", "Dean", "Harvey", "Mick", "John"]
- string = "Adam lives in New York"
- print("The original list is: " + str(name_list))
- print("The original string is: " + string)
- result = any(item in string for item in name_list)
- print("Does the string contain any name from the list: " + str(result))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement