Basic replacement
Input
simple_template('Hello {name}!', {'name': 'Alice'})
Output
'Hello Alice!'
The placeholder {name} is replaced with 'Alice'.
Full lesson preview
Create a minimal named-placeholder template formatter supporting escaped braces.
Problem statement
Task
Examples
Input
simple_template('Hello {name}!', {'name': 'Alice'})
Output
'Hello Alice!'
The placeholder {name} is replaced with 'Alice'.
Input
simple_template('{{greet}} {who}', {'who': 'world'})
Output
'{greet} world'
Double braces produce a single literal brace in output.
Input format
Output format
Constraints
Samples
Input
simple_template('X{a}Y{b}Z', {'a': 1, 'b': 2})
Output
'X1Y2Z'
Multiple placeholders are replaced in sequence.