Exerpad
🔥0
0 XP
Lv.1 Beginner
Log In

Add to List

Start with a vector containing "cat" and "dog". Then push "fish" onto the end. Print all 3 animals, one per line.

Expected output:

text
cat
dog
fish

Hints:

  • Create the vector with let mut pets = vec!["cat", "dog"];
  • Use .push("fish") to add the third item
  • Loop through the vector to print each animal
rust
fn main() {
}