Map vector
Rust
#![allow(unused)] fn main() { let v = vec![1, 2, 3]; let new_vec = v.iter().map(|num| { num * 2 }); }
Python
v = [1, 2, 3];
new_vec = map(num * 2, v)
#![allow(unused)] fn main() { let v = vec![1, 2, 3]; let new_vec = v.iter().map(|num| { num * 2 }); }
v = [1, 2, 3];
new_vec = map(num * 2, v)