Challenge 2: Declare a Tuple
In this challenge, you are required to make a tuple.
We'll cover the following
Problem Statement
- Declare a tuple,
persons
, of size 6 that has the names of people along with their ages - Print the value of
persons
Output
The output of the code should be:
Alex:21, Abe:22, Anna:23
Coding Exercise
Write your code below. It is recommended​ that you try solving the exercise yourself before viewing the solution.
Note: There is a
test
function given in the code for testing purposes. Do not modify it.
Important Note: Use the dot operator (
.
) for accessing the values of the tuple. Do not use a debug trait.
Good luck!🤞
Create a free account to access the full course.
Continue your learning journey with a 14-day free trial.
By signing up, you agree to Educative's Terms of Service and Privacy Policy