Basic greeter
Input
make_greeter("Hello")("Alice")
Output
Hello, Alice!
make_greeter captures 'Hello' and uses the default punctuation '!' to greet Alice.
Full lesson preview
Learn to build simple function factories using closures that produce customized greeting functions.
Problem statement
Task
Examples
Input
make_greeter("Hello")("Alice")
Output
Hello, Alice!
make_greeter captures 'Hello' and uses the default punctuation '!' to greet Alice.
Input format
Output format
Constraints
Samples
Input
make_greeter("Hi", "?")("Sam")
Output
Hi, Sam?
Custom punctuation '?' is used.