β back to unit
Easy
# searching easy
The Richest Pirate's Treasure
Every pirate on the ship brags about their gold β settle it once and for all! π΄ββ οΈ
You get a list of pirate names and a matching list of gold amounts (same order, at least one pirate, no ties). Print the name of the richest pirate.
Example:
Input: names = ["anne", "jack", "mo"], gold = [300, 750, 120]
Output: jack
Comparing the gold amounts, 750 (jack's) is the biggest β and since names[1] is jack, that's who we print.
π‘ need a hint?
srch-richest-pirate.pyπ given lines are locked β write your code in between
loading...