if的例子在前面已经接触。为了完整性。这里给出了一些例子。
>>> choice = 'bacon'
>>> dic = {'bacon':1, 'new':2}
>>> if choice in dic:
print(dic[choice])
end..
参见其它章节
if的例子在前面已经接触。为了完整性。这里给出了一些例子。
>>> choice = 'bacon'
>>> dic = {'bacon':1, 'new':2}
>>> if choice in dic:
print(dic[choice])
end..
参见其它章节