Pybites Logo Rust Platform

Fibonacci Sequence

Medium +3 pts

🎯 Python 3.10 introduced structural pattern matching with match/case. Rust has had match from the start — and it's one of the language's most powerful features.

match in Rust

Where Python uses if/elif chains or match/case, Rust uses match expressions:

match n { 0 => println!("zero"), 1 => println!("one"), _ => println!("something else"), // _ is the catch-all (like Python's case _) }

Two things make Rust's match

Login to see the full exercise.