Skip to content

Commit ce1c14b

Browse files
author
Olaf Gladis
committed
revert yield from and add pep8 / black required new lines
1 parent f3d34d4 commit ce1c14b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Level_08/generatoren.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
# Generatoren und yield
44
def gen(s):
5-
yield from s
5+
for char in s:
6+
yield char
7+
68

79
# iterieren mit einer for-Schleife:
810
for x in gen("abcdef"):
@@ -23,14 +25,17 @@ def f(x):
2325
# IN: f(3)
2426
# OUT: 9
2527

28+
2629
def dec(func):
2730
def inner_func(*args):
2831
print(args)
2932
r = func(*args)
3033
print("Return: {}".format(r))
3134
return r
35+
3236
return inner_func
3337

38+
3439
@dec
3540
def f(x):
3641
return x**2

0 commit comments

Comments
 (0)