3 ms·
What about.. def template(name, age): return f"My name is {name} and I am {age} .." formatted = template('Amy', 32) ? [Edit: I only started l
by spraak 10y ago
What about..
def template(name, age):
return f"My name is {name} and I am {age} .."
formatted = template('Amy', 32)
?
[Edit: I only started learning Python recently, and this is how I'd think of doing it come from JS:
const template = (name, age) => `My name is ${name} and I am ${age}`;
const formatted = template('Amy', 32);
]
- mixmastamyk 10y agoCheck string.Template from the docs.