Get min and max of two values
Rust
#![allow(unused)]
fn main() {
use std::cmp::{min, max};
let (max_v, min_v) = (max(10, 50), min(10, 50));
}
Python
max_v, min_v = max(10, 50), min(10, 50)
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
#![allow(unused)]
fn main() {
use std::cmp::{min, max};
let (max_v, min_v) = (max(10, 50), min(10, 50));
}
max_v, min_v = max(10, 50), min(10, 50)