GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — code_snippets/For_Else/find.py at master · WhyzeAnthony/code_snippets Expand file tree/ Copy pathfind.pyMore file actions 14 lines (10 loc) · 292 Bytes / Copy pathfind.pyFile metadata and controls14 lines (10 loc) · 292 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 def find_index(to_search, target): for i, value in enumerate(to_search): if value == target: break else: return -1 return i my_list = ['Corey', 'Rick', 'John'] index_location = find_index(my_list, 'Steve') print 'Location of target is index: {}'.format(index_location) |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |