tests/list.py | raw changeset files shortlog |
1.1 --- a/tests/list.py Tue Nov 29 23:12:15 2016 +0100 1.2 +++ b/tests/list.py Tue Nov 29 23:13:18 2016 +0100 1.3 @@ -33,3 +33,11 @@ 1.4 print 4 not in l # True 1.5 print "four" not in l # False 1.6 print "one" not in l # True 1.7 + 1.8 +print l.index(1) # 0 1.9 +print l.index("four") # 3 1.10 + 1.11 +try: 1.12 + print l.index(4) # should raise an exception 1.13 +except ValueError, exc: 1.14 + print "l.index(4): failed to find argument", exc.value