Question: ```
import random

number = random.sample(range(0,9999), 10)
print(number, file = open("output.txt","a"))

```

I want to add (prefix) characters to a randomly generated number.
e.g. `AAA(number)` so that it will become something like `AAA4525`. What's the best way to do it?

Answer: 
```
import random
PREFIX = 'AAA'
numbers = random.sample(range(0,10000), 10) # to include also 9999
with open("output.txt","a") as f:
    for number in numbers:
        f.write(f'{PREFIX}{number:0>4d}\n')

```
Simple Concatenation can do the trick for you ..

```
def converter():
     string="AAA"
     ans= string+str(number) 
     return ans

```