(numbers, group)
| 110 | |
| 111 | print("Example 7") |
| 112 | def sort_priority3(numbers, group): |
| 113 | found = False |
| 114 | |
| 115 | def helper(x): |
| 116 | nonlocal found # Added |
| 117 | if x in group: |
| 118 | found = True |
| 119 | return (0, x) |
| 120 | return (1, x) |
| 121 | |
| 122 | numbers.sort(key=helper) |
| 123 | return found |
| 124 | |
| 125 | |
| 126 | print("Example 8") |