for loop
202307072008
Status: #idea
Tags: Rust
for loop
- For loops are Pythonic, i.e. they iterate through collections
let a = [10, 20, 30];
for x in a {
println!("Current element is: {x}");
}
for t in (1..4).rev() { // Range object [start, end)
println!("{t}!");
}
println!("LIFTOFF!!!")