Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Random number in range

Rust

#![allow(unused)]
fn main() {
use rand::Rnd;
let n = rand::thread_rng().gen_range(0..10)
}

Python

import random
n = random.randint(0, 10)