I want to call a string's lower method from within the template string. This would ideally look something like
string = "Lowercase: {value.lower()}"
string.format(value=...)
However, this gives me an error saying AttributeError: 'str' object has no attribute 'lower()' (I understand why I'm getting this error).
I'm wondering if there's a way to achieve this. I've looked at using conversion (like '{value!r} for calling repr) but that didn't fix my problem. Could I create a custom conversion specifier?
(For the record, string.format(value=value.lower()) will not necessarily work in my case.)
f"Lowercase: {value.lower()}"string.format(...), not necessarily a variable on its own.