Q:

Combining 2 codes in Python

I have generated these two codes.
The first generates a country according to the probability given by the number of customers in each country:
import random
selectp = random.choices(
        population=["A", "B", "C", "D", "E"],
    weights=[0.2307, 0.0769, 0.3846, 0.1923, 0.1153],
    k=1
)
print(selectp)

And the second generates a random number of 4 characters by filling in the numbers on the left with zero where appropriate:
import random
num = random.randrange(1, 9999)
# using string's zfill
num_with_zeros = str(num).zfill(4)
print (num_with_zeros)

What I need to do is to combine these codes to generate a result of the following type, for example, in a random way:
A-0213, B-2345, A-0001...

The added complication is that for each letter there are a limited number of combinations, which are:

For A, the numbers will go from A-0000 to A-0300
For B, the numbers will go from B-0000 to B-0100
For C, the numbers will go from C-0000 to C-0500
For D, the numbers will go from D-0000 to D-0250
For E, the numbers will go from E-0000 to E-0150

Any idea how to do it? 

Edit:
So what I need is a code that randomly generates a combination of the type:
A-0001, B-0035...
keeping in mind that the probability distribution for the letters is:

A = 0.2307
B = 0.0769
C = 0.3846
D = 0.1923
E = 0.1153

And that the number must be between the following numbers:

For A, the numbers will go from A-0000 to A-0300
For B, the numbers will go from B-0000 to B-0100
For C, the numbers will go from C-0000 to C-0500
For D, the numbers will go from D-0000 to D-0250
For E, the numbers will go from E-0000 to E-0150

A:

You will need a dictionary to store what the allowed numbers are, and then you can simply add to strings with +
import random

max_vals = {"A": 300, "B": 100, "C": 500, "D": 250, "E": 150}

def random_code():
    letter = random.choices(list(max_vals.keys()),
                            weights=[0.2307, 0.0769, 0.3846, 0.1923, 0.1153],
    k=1)[0]
    num = random.randrange(0, max_vals[letter]) # You allow 0000 in the examples in the question
    # using string's zfill
    num_with_zeros = str(num).zfill(4)
    return letter + "-" + num_with_zeros

for _ in range(10):
    print(random_code())

