6-9 配合in與not in的使用
1. in
depts = ['會資', '財金', '財稅', '商務', '企管', '資管', '應外'] #台北校區的科系
if '數媒' in depts: #判斷是否在台北校區
print('在台北校區')
else:
print('不在台北校區')不在台北校區
2. not in

自主練習
Last updated
depts = ['會資', '財金', '財稅', '商務', '企管', '資管', '應外'] #台北校區的科系
if '數媒' in depts: #判斷是否在台北校區
print('在台北校區')
else:
print('不在台北校區')不在台北校區

Last updated
depts = ['會資', '財金', '財稅', '商務', '企管', '資管', '應外'] #台北校區的科系
if '數媒' not in depts: #判斷是否不在台北校區
print('不在台北校區')
elif '數媒' in depts:
print('在台北校區')不在台北校區