- Executors
-
Learn
Learn Python Runnable examples, NumPy, pandas, and more Learn AINeural networks, ML and LLMs from scratch Learn C & C++ Pointers, memory, STL, and modern C++ Learn C#C# basics, OOP, LINQ, async, and .NET exercises Learn MatplotlibLine, bar, scatter and pie charts with live visualizers Learn RustOwnership, traits, error handling, and threads Learn GoSlices, interfaces, goroutines, and channels Python Algorithms Search, sorting, recursion, and visualizers O(n) C & C++ Algorithms Compare algorithms implemented in C and C++ Coding for Kids Learn to code by playing!
- ChallengesNew
- For TeachersNew
- Updates
- Buy me a coffee
Rust fundamentals
From your first program to variables, types, conditions, loops, strings, vectors and functions, with a challenge after each topic.
1 Getting started 5 lessons
- Lesson 2 challenges Hello World and Program Structure Write your first Rust program and learn what fn main and println! do.
- Lesson 2 challenges Variables and Mutability Declare variables with let, allow changes with mut, and use constants and shadowing.
- Lesson 2 challenges Data Types Work with integers, floating-point numbers, booleans and characters, and convert between them.
- Lesson 2 challenges Operators and Arithmetic Use arithmetic, comparison and logical operators, and see how integer division works.
- Lesson 2 challenges Reading User Input Read a line from the keyboard and turn it into a number safely.
2 Making decisions 2 lessons
- Lesson 2 challenges Conditions with if and else Choose what runs with if, else if and else, and use if as an expression.
- Lesson 1 challenge FizzBuzz Solve the classic FizzBuzz problem with match on a tuple.
3 Loops 2 lessons
- Lesson 2 challenges Loops: for, while and loop Repeat code with for over a range, while with a condition, and loop with break.
- Lesson 2 challenges Prime Numbers Check whether a number is prime and list the primes up to 30.
4 Strings and text 2 lessons
- Lesson 2 challenges Strings: String and &str Create, grow, search and split text with Rust's two string types.
- Lesson 1 challenge Reverse a String Reverse the characters of a string and the words of a sentence.
5 Collections 3 lessons
- Lesson 2 challenges Tuples and Arrays Group values with tuples and store a fixed number of items in an array.
- Lesson 2 challenges Vectors Store a growing list of values in a Vec and read items safely.
- Lesson 2 challenges Fibonacci Sequence Generate Fibonacci numbers with a loop and a vector.
6 Functions 2 lessons
- Lesson 2 challenges Functions and Return Values Define functions with typed parameters and return values.
- Lesson 2 challenges Binary Search Find a value in a sorted slice by halving the search range.