Actually, it does work, just not as intended. By using the input function, you are asking the user for their input. So, what your program does now is prompts input by displaying a and b rather than using a and b as numbers. After answering the input, it does its math. To fix this, take away the input part (which also makes int unnecessary).
def add2(a,b):
BRModules.BRMEM.mem0 = a
BRModules.BRMEM.mem1 = b
print(BRModules.BRMEM.mem0+BRModules.BRMEM.mem1)
BRModules.BRMEM.mem0 = str(BRModules.BRMEM.mem0)
BRModules.BRMEM.mem1 = str(BRModules.BRMEM.mem1)
The question is, why does the BRMEMFUNC module print everything that’s in memory? It makes the output confusing. 2 is the result of add2(1,1), but the rest is just confusing. For storing variables like you seem to be trying to do, you might be better off to store them in a text file.
EDIT: I got variables stored in text files working. Either use this code, or run in Replit shell pip install coderelijah, then add to your Py file from CoderElijah import addStorage, accessStorage. Basically, addStorage writes data to a text file, and accessStorage retrieves data from a given line of a text file. However, you can’t (at least with these functions), write to a specific line in a text file, so you would want to make a separate file for each variable. You also have to create the text file beforehand. There are only three reasons I know of that you would want to store a variable in a text file:
To archive data
To make a variable to use across different files
Because you’re having trouble with global variables.