Question: I have a text document and I need to add two @ symbols before the keywords present in an array.

**Sample text and Array:**

```
str ="This is a sample text document which consists of all demographic information of employee here is the value you may need,name: George employee_id:14296blood_group:b positive this is the blood group of the employeeage:32"

arr=['name','employee_id','blood_group','age']

```

**Required Text:**

```
str ="This is a sample text document which consists of all demographic information of employee here is the value you may need, @@name: George @@employee_id:14296 @@blood_group:b positive this is the blood group of the employee @@age:32"

```

Answer: 
Just use the `replace` function

```
str ="This is a sample text document which consists of all demographic information of employee here is the value you may need,name: George employee_id:14296blood_group:b positive this is the blood group of the employeeage:32"
arr = ['name','employee_id','blood_group','age']

for w in arr:
    str = str.replace(w, f'@@{w}')
print(str)

```
You can simply loop over arr and use the str.replace function:

```
for repl in arr:
    strng.replace(repl, '@@'+repl)

print(strng)

```

However, I urge you to change the variable name `str` because it is a reserved keyword.