(a)
| 103 | |
| 104 | print("Example 7") |
| 105 | def bubble_sort(a): |
| 106 | for _ in range(len(a)): |
| 107 | for i in range(1, len(a)): |
| 108 | if a[i] < a[i - 1]: |
| 109 | temp = a[i] |
| 110 | a[i] = a[i - 1] |
| 111 | a[i - 1] = temp |
| 112 | |
| 113 | names = ["pretzels", "carrots", "arugula", "bacon"] |
| 114 | bubble_sort(names) |