Returns a random item from a list.
aElem = RandPick(lList)
Variable | Description |
---|---|
aElem | A random item from the list. ANYTYPE. |
laList | The list to pick a random item from. LIST OF ANYTYPE. |
RandPick returns a random item from laList. The item can have any data type.
[-] testcase RandPickExample() [ ] LIST OF STRING lsItems [ ] STRING sRandomItem [-] lsItems = {...} [ ] "Clam Chowder" [ ] "Fried Chicken" [ ] "Lobster" [ ] "Green Eggs and Ham" [ ] sRandomItem = RandPick (lsItems) [ ] Print("The special of the day is {sRandomItem}.")