2009-10-29から1日間の記事一覧
# coding: utf-8 lst = [True, False, None] def f(index): try: print lst.index(index) except Exception, e: print "exception was raised: ", e # False,True,Noneそれぞれに対してインデクシングすると # それぞれ1,0,2が返り値 f(False) f(True) f(Non…
# coding: utf-8 lst = [True, False, None] def f(index): try: print lst.index(index) except Exception, e: print "exception was raised: ", e # False,True,Noneそれぞれに対してインデクシングすると # それぞれ1,0,2が返り値 f(False) f(True) f(Non…