You are setting out on a grand island adventure—today you will practise building lists using input, and exploring your collections using loops, conditions, and functions to prepare for the journey ahead.
Create an empty list called treasure_chest.
Use a for loop to ask the user to enter 4 treasures they find on the island.
Add each treasure to the list using .append().
👉 Reminder: When you want to print each item separately, use a for loop like for item in treasure_chest:.
Use a for loop to print each treasure on a new line.
Create an empty list called destinations.
Use a while loop to ask the user for places they want to sail to, stopping when there are 5 destinations.
👉 Reminder: When checking how many items you have, use len(destinations).
After the loop, use if/else to check:
If there are exactly 5 places, print the second and last destination using indexing.
Else, print an error message.
Write a function called choose_snacks().
Inside the function, use a for loop to ask the user for 3 beach snacks and add each one to a list.
Return the list.
Outside the function:
👉 Reminder: To show each item, use a for loop like for snack in snacks:.
Print each snack on its own line.
Create an empty list called sports.
Use a for loop to ask the user for 3 sports they want to play during the island adventure.
Then use another for loop to print a full sentence for each one like:
👉 Reminder: Loop through your list with for sport in sports: to use each item.
Example output:
I can’t wait to play [sport] on the island!
Create an empty list called movies.
Use a for loop to ask the user for 5 movies they want to watch at a beach cinema.
Then:
👉 Reminder: If you need both the position and the movie name, use range(len(movies)).
Use a for loop with range(len(movies)) to print each movie and its number like:
Movie 0 is [movie name], Movie 1 is [movie name], etc.
Create a dictionary called explorer.
Ask the user for their name, age, and island role (example roles: "sailor", "explorer", "treasure hunter").
Store these as key-value pairs inside explorer.
👉 Reminder: Each key must be in quotation marks " " and linked to its value with a colon :.
Finally, print the full dictionary.
Use the dictionary you created in Activity 6 (explorer).
Ask the user what information they want to retrieve: "name", "age", or "role".
👉 Reminder: Use .get(key) to retrieve a value from the dictionary.
Print the requested information back to the user.
You have landed on a secret island. Complete all 5 coding tasks as fast as you can!
1. Supplies List
Create an empty list supplies.
Use a for loop to ask the user 3 times for a supply item.
Append each item to the list.
Then print each item one by one using for item in supplies:.
2. Destination Planning
Create an empty list destinations.
Use a while loop to keep asking for destination names until there are 4 (Use len(destinations) to check.)
Print the full list of destinations.
3. Treasure Check
Ask for one treasure name.
Use if/elif/else:
If "gold" or "jewel", print "Rare treasure found!"
Else, print "Common treasure found!"
4. Explorer Profile (Dictionary)
Create a dictionary explorer with keys "name", "age", and "role".
Ask the user for each value and store them.
5. Quick Info Access
Ask what info to show: "name", "age", or "role".
Use .get() to retrieve and print the value from explorer.