Q:

Replace whole word Python (only variable)

I am trying to do a code which replace only whole word in string variable.First of all I found re.sub solution but there was no mentioned about variable inside. 
Now my solution looks (it does not replace whole word): 
for index in (range(len(lista)):
    query=query.replace(lista[index],var)

As on example above, I want to replace value in lista[index] with value from VAR -> variable.
EDIT:
Example query:
Select Information,AdditionalInformation,Price from Table

example lista vales:
Information, Price 

example var:
var = "hide"

Finally query should looks:
Select hide,AdditionalInformation,hide from Table

A:

I think this should work:
for word in alist:
    query = re.sub(r'\b'+word+r'\b',var,query)

