Python, for all its power and popularity, has long lacked a form of flow control found in other languages—a way to take a value and match it elegantly against one of a number of possible conditions.
Does anyone know of a way to easily check if a list in Python contains a particular string, e.g.<BR><pre class="ip-ubbcode-code-pre">foo.contains("bar")</pre><BR>I'm ...
当前正在显示可能无法访问的结果。
隐藏无法访问的结果
反馈