...

/

Solution Review 2: Declare a Tuple

Solution Review 2: Declare a Tuple

This lesson gives a detailed solution review of the challenge in the previous lesson.

We'll cover the following...

Solution:

Press + to interact
fn test() {
// define a tuple
let persons = ("Alex",21, "Abe", 22, "Anna", 23);
// print the values of tuple
print!("{}:{}, {}:{}, {}:{}", persons.0, persons.1, persons.2, persons.3, persons.4, persons.5);
}
...

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy