for循環中的in 返回的是集合中的一個元素
成員運算符的in返回的是邏輯值結果True/False
fish_record='鯽魚5條、鯉魚8條、鰱魚7條、草魚2條、黑魚6條、烏龜1只'
if '烏龜' in fish_record: #成員運算符
print('烏龜在字符串')
else:
print('烏龜不在字符串裏')
if 15 not in range(10): #成員運算符
print('15不在集合裏')
else:
print('15在集合裏')
運行結果