Demonstrate how to pick a random element from a list.




extern crate rand;
 
use rand::Rng;
 
fn main() {
    let array = [5,1,2,5,6,7,8,1,2,4,5];
    let mut rng = rand::thread_rng();
 
    println!("{}", rng.choose(&array).unwrap());
}