I have 4 different algorithms each of which does different things on my data and they generate different outputs. I want to define only one piece of code instead of having four blocks of code for easier maintenance. However, I will have to name some variables dynamically. For example, if the algorithms names are A, B, C and D then, I should have 4 variables called output_A, output_B, output_C and output_D. How can I define this as something like output_{} which I can dynamically pass the algorithms names to it?
I know how to do this when the text is a number. For example, this code defines the varaible names as they have a postfix (01,02,03, ...) to their end.
predicted_file_format_UB = "UB_epoch{:02}.csv"
So, UB_epoch{:02}.csv will be UB_epoch01.csv, UB_epoch02.csv, UB_epoch03.csv etc. But I don't know how to do it when it's a text and the length is not constant. Different algotithms may have different name length.