dir() #will give you the list of in scope variables:
globals() #will give you a dictionary of global variables
locals() #will give you a dictionary of local variables
print("for class ", c, ' the minimum is where theta equals ', res.x, ' and the minimum is', res.fun)