Python Basic/Think Python1 [ Think Python ] function object A function object is a value you can assign to a variable or pass as an argument. For example, do_twice is a function that takes a function object as an argument and calls it twice: Here’s an example that uses do_twice to call a function named print_spam twice: def do_twice(f): f() f() def print_spam(): print('spam') print('spam') do_twice(print_spam) Exercise 3-2. 1. Type this example into a sc.. 2022. 11. 20. 이전 1 다음