diff --git a/ch08-modules/e36b3_fromkeys_func.py b/ch08-modules/e36b3_fromkeys_func.py index ac76409..be6fa72 100755 --- a/ch08-modules/e36b3_fromkeys_func.py +++ b/ch08-modules/e36b3_fromkeys_func.py @@ -4,9 +4,4 @@ def fromkeys_func(s, func): - output = {} - - for one_item in s: - output[one_item] = func(one_item) - - return output + return {key: func(key) for key in s}