Thank millions for sharing and caring!
I need to create and use symbols in dynamic way. In fact, symbols are made based on user input and used in code so I must use f'strings to make them. As shown below:
L= ['xCl', 'xNa']
for j in range(len(L)):
locals()[L[j]] = sympy.symbols(L[j])
i = 'Na'
j = 'Cl'
gg = f"x{i}" * f"x{j}"
print('gg:', gg)
But I received the following error:
TypeError: can't multiply sequence by non-int of type 'Symbol'
While I need to have: gg = xCl * xNaCl Could possibly let me know how can do it.