I am looking for a function to call that modifies the end of a variable name with a string, stored in an other variable. Is there a way to do this with a line of code, or do I need a for loop?
#For instance: Defined a string size, and floats to indicate the price for each size:
Size = 'M'
Price_S = 1.52
Price_M = 2.62
Price_L = 3.98
#Now I want to set a float cost to one of the price variables, depending on the value of Size:
cost = Price_(insert string from Size)
#So effectively it will be cost = price_M