<s>[INST] I have some rectangular prism dice, and I'd like to find out the probability of rolling a certain number on a certain side of the die. For example, I might have a die with 3 faces with the number 1 on it, 2 faces with the number 2, and 2 faces with the number 3. I'd like to be able to enter the number of faces on each side, and have the program return the probability of each number appearing. 

This is the code I've written so far:
```
import random

def roll_dice(n_faces, n_sides):
    return random.choices(range(1, n_sides + 1), [n_faces[i] for i in range(n_sides)])

def calculate_probability(n_faces, n_sides):
    total_faces = sum(n_faces)
    probabilities = []
    for i in range(n_sides):
        probabilities.append(n_faces[i] / total_faces)
    return probabilities

def main():
    n_sides = int(input("Enter the number of sides: "))
    n_faces = []
    for i in range(n_sides):
        num_faces = int(input(f"Enter the number of faces with number {i + 1}: "))
        n_faces.append(num_faces)

    roll = roll_dice(n_faces, n_sides)
    probability = calculate_probability(n_faces, n_sides)
    print("Roll:", roll)
    for i in range(n_sides):
        print(f"P({i + 1}) = {probability[i]}")

if __name__ == "__main__":
    main()
```
This code currently allows the user to enter the number of sides on the die and the number of faces for each number, and then it will roll the die and calculate the probability of each number appearing.

However, I'd like to be able to roll the die multiple times and then calculate the frequency of each number appearing. I'd like to be able to print out a histogram of the results as well.

I've tried adding a for loop to the `roll_dice` function, but that didn't seem to work. I'm not sure how to modify my existing code to achieve this. Can you help?[/INST]