9 lines
150 B
Python
9 lines
150 B
Python
def odd(limit):
|
|
current = 1
|
|
while current <= limit:
|
|
yield current
|
|
current += 2
|
|
|
|
|
|
# Testen
|
|
print(list(odd(10))) # Ausgabe: [1, 3, 5, 7, 9] |