|
72 | 72 | print('Positiv number')
|
73 | 73 | else:
|
74 | 74 | print('Negativ number')
|
| 75 | + |
| 76 | +print('----------------------------') |
| 77 | + |
| 78 | +numbers = [1, 2, 3, 4, 5] |
| 79 | +for num in numbers: |
| 80 | + print(num) |
| 81 | + |
| 82 | +print('----------------------------') |
| 83 | + |
| 84 | +fruits = ["apple", "banana", "cherry"] |
| 85 | +for x in fruits: |
| 86 | + print(x) |
| 87 | + |
| 88 | +print('----------------------------') |
| 89 | + |
| 90 | +days = ['Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'] |
| 91 | +for day in days: |
| 92 | + print(day) |
| 93 | + |
| 94 | +print('----------------------------') |
| 95 | + |
| 96 | +fruits = ["apple", "banana", "cherry"] |
| 97 | +for x in fruits: |
| 98 | + print(x) |
| 99 | + if x == "banana": |
| 100 | + break |
| 101 | + |
| 102 | +print('----------------------------') |
| 103 | + |
| 104 | +days = ['Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'] |
| 105 | +for day in days: |
| 106 | + print(day) |
| 107 | + if day == "Monday": |
| 108 | + break |
| 109 | + |
| 110 | + |
| 111 | +print('----------------------------') |
| 112 | + |
| 113 | +fruits = ["apple", "banana", "cherry"] |
| 114 | +for x in fruits: |
| 115 | + if x == "banana": |
| 116 | + continue |
| 117 | + print(x) |
| 118 | + |
| 119 | + |
| 120 | +print('----------------------------') |
| 121 | + |
| 122 | +days = ['Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'] |
| 123 | +for day in days: |
| 124 | + if day == "Monday": |
| 125 | + continue |
| 126 | + print(day) |
| 127 | + |
| 128 | + |
| 129 | +print('----------------------------') |
| 130 | + |
| 131 | +numbers = [1, 2, 3, 4, 5] |
| 132 | +for x in numbers: |
| 133 | + print(x) |
| 134 | +else: |
| 135 | + print("Finally finished") |
| 136 | + |
| 137 | + |
| 138 | +print('----------------------------') |
| 139 | + |
| 140 | +adj = ["red", "big", "tasty"] |
| 141 | +fruits = ["apple", "banana", "cherry"] |
| 142 | +for x in adj: |
| 143 | + for y in fruits: |
| 144 | + print(x, y) |
| 145 | + |
| 146 | +print('----------------------------') |
| 147 | + |
| 148 | +i = 0 |
| 149 | +while i < 6: |
| 150 | + print(i) |
| 151 | + i += 1 |
| 152 | + |
| 153 | +print('----------------------------') |
| 154 | + |
| 155 | +i = 0 |
| 156 | +while i < 6: |
| 157 | + i += 1 |
| 158 | + if i == 3: |
| 159 | + continue |
| 160 | + print(i) |
| 161 | + |
| 162 | + |
| 163 | +print('----------------------------') |
| 164 | + |
| 165 | + |
| 166 | +i = 1 |
| 167 | +while i < 6: |
| 168 | + print(i) |
| 169 | + i += 1 |
| 170 | +else: |
| 171 | + print("i is no longer less than 6") |
0 commit comments