Check out example codes for "get random value from list c#". It will help you in understanding the concepts better.

Code Example 1

/// <summary>
/// Get random values from a list and return a list of chosen items
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="passedList"></param>
/// <param name="numberToChoose"></param>
/// <returns></returns>
public List<T> GetRandomFromList<T>(List<T> passedList, int numberToChoose)
    System.Random rnd = new System.Random();
    List<T> chosenItems = new List<T>();

    for (int i = 1; i <= numberToChoose; i++)
      int index = rnd.Next(passedList.Count);


    return chosenItems;

Code Example 2

list[Random.Range(0, list.Count)];

Learn ReactJs, React Native from