Increment dict value
Rust
#![allow(unused)] fn main() { let mut map: HashMap<u64, u64> = HashMap::new(); *map.entry(50).or_insert(0) += 1; }
Python
map = {}
map[50] = map.get(50, 0) + 1
#![allow(unused)] fn main() { let mut map: HashMap<u64, u64> = HashMap::new(); *map.entry(50).or_insert(0) += 1; }
map = {}
map[50] = map.get(50, 0) + 1