Check if Item Exists in List in Python

preview_player
Показать описание
Check if Item Exists
To determine if a specified item is present in a list use the in keyword:

Example
Check if "apple" is present in the list:

thislist = ["apple", "banana", "cherry"]
if "apple" in thislist:
print("Yes, 'apple' is in the fruits list")
Рекомендации по теме
welcome to shbcf.ru