Pybites Logo Rust Platform

Factorial

Easy +2 pts

🎯 In Python, you never worry about integer size — math.factorial(100) returns a 158-digit number without breaking a sweat. Python integers grow as large as memory allows.

Rust integers have fixed sizes. A u64 maxes out at 18,446,744,073,709,551,615. That sounds huge, but 21! already exceeds it — factorials grow fast. In debug mode, Rust panics on integer overflow rather than silently wrapping around. This is a safety feature: it catches bugs that would go unnoticed in C.

Login to see the full exercise.