Say let's say there's a string in python like
'f"{var_1} is the same as {var_2}"'
or something like
"{} is the same as {}".format(var_1, var_2)
Is there a way to count the number of insertion strings that exist in the string?
I'm trying to create a function that counts the number of insertions in a string. This is because I have code for generating a middle name and it could generate 2 or 1 middle name and just to keep the code consistent I'd rather it count the number of insertions exists in the string.