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 tuplelet persons = ("Alex",21, "Abe", 22, "Anna", 23);// print the values of tupleprint!("{}:{}, {}:{}, {}:{}", persons.0, persons.1, persons.2, persons.3, persons.4, persons.5);}
Explanation
- On line 3, a