3 Antworten
+ 5
I don't really know what you're trying to do, what kind of variable that is and why it needs to be done in one line of code, but in case it's a string, you can try something like:
var = '{hei{123}}'
print(var.replace('{', '', 1).replace('}}', '}'))
+ 1
What is that variable supposed to be? It's not even python syntax
It is probably possible if you clarify what kind of data that is supposed to be
+ 1
thanks