1. Your first generator
Write code Easy ✓ CompletedWrite a generator function count_up(limit) that yields the numbers 1, 2, 3, … up to and including limit. For example list(count_up(3)) is [1, 2, 3]. Use yield, not a list.
def count_up(limit):
# yield 1, 2, ..., limit
pass
for n in count_up(3):
print(n)def count_up(limit):
n = 1
while n <= limit:
yield n
n += 1
for n in count_up(3):
print(n)