04.04 · Transform and filter values / Practice · 13 min
Standardize names, magnitudes and paired differences
Each input needs its own transformation; the function determines what happens to every item.
Activity 4 of 6 in Transform and filter values
Python 3: Lists / 04.04
Practice list mapping
Not started
Adapt all three revised source map tasks with predictable inputs.
Your lesson progress
Empty: not started. Yellow: in progress. Green: complete. Marking the whole activity complete does not replace your test results. These circles save in this browser for this pilot.

Your task: three transformations
Keep names as ["John", "JANE", "alice"]. Use map and str.capitalize to produce standard_names as ["John", "Jane", "Alice"]. This is a mechanical case exercise, not a rule for how every person’s name should be written.
Keep signed_numbers as [-5, 3, -1, 9, -2]. Map abs across them and collect magnitudes as [5, 3, 1, 9, 2].
Keep left as [2, 4, 6] and right as [1, 3, 5]. Use map with a two-argument function to produce differences [1, 1, 1]. Print standard_names, magnitudes and differences in that order. Preserve all original lists.
Check the stored lists
The checks inspect output, all source lists and the three stored result lists, not whether map produced them. Review your code for the intended technique. After passing, shorten right to two items and predict how many differences map will produce. Restore the original inputs before checking again.
Build it one step at a time
Prefer learning by typing? Work through short instructions, run the Python code and check each change before continuing. Your guided project saves separately from the challenge below.
The mini-lesson opens in a new tab. Your own code carries forward; each step has a focused check and an optional hint.
Start mini-lesson(opens in a new tab)4 steps · Saved work · Instant feedback
YOUR TURN
Apply all three source transformations
Use map to produce standard_names, magnitudes and paired differences. Collect actual lists, preserve every input and print the three results in order.
['John', 'Jane', 'Alice'] [5, 3, 1, 9, 2] [1, 1, 1]
Keep the starting inputs. Print these lines in this order, without extra output.
- Store the requested names
- Store the requested signed numbers
- Store the requested left
- Store the requested right
- Store the requested standard names
- Store the requested magnitudes
- Store the requested differences
- Output 1 matches the requested result
- Output 2 matches the requested result
- Output 3 matches the requested result
Edit Python, then run it. Check challenge checks your output and the listed Python requirements. Your code saves on this browser after a short pause. Sign in and choose Save account draft to keep it across devices. Word wrap is enabled.
Ready to checkRun the checks to see your results here.
Your check results
Need a nudge?
Pass a callable
Use str.capitalize and abs without calling them first. Wrap the map results in list.
Pair two arguments
The lambda receives one value from left and one from right; subtract the second from the first.
One possible solution
Your code may look different and still be correct. Compare the approach with your own.
Each source list keeps its values. The transformations produce new lists whose elements follow the chosen callable.
Walk through the fix.
Choose Next to inspect one change at a time. Highlighted lines show what to notice. Your editor stays unchanged unless you choose to load a step.
Step 1 of 2
Read the original inputs
Identify the original values before choosing the transformation or keep rule.
names = ["John", "JANE", "alice"]Expected output for this step
(No output)
Apply the function and inspect each result
Each source list keeps its values. The transformations produce new lists whose elements follow the chosen callable.
names = ["John", "JANE", "alice"]
signed_numbers = [-5, 3, -1, 9, -2]
left = [2, 4, 6]
right = [1, 3, 5]
standard_names = list(map(str.capitalize, names))
magnitudes = list(map(abs, signed_numbers))
differences = list(map(lambda first, second: first - second, left, right))
print(standard_names)
print(magnitudes)
print(differences)Expected output for this step
['John', 'Jane', 'Alice'] [5, 3, 1, 9, 2] [1, 1, 1]
See the complete solution
names = ["John", "JANE", "alice"]
signed_numbers = [-5, 3, -1, 9, -2]
left = [2, 4, 6]
right = [1, 3, 5]
standard_names = list(map(str.capitalize, names))
magnitudes = list(map(abs, signed_numbers))
differences = list(map(lambda first, second: first - second, left, right))
print(standard_names)
print(magnitudes)
print(differences)Ready to try it?
Practice in your browser and see your results.
Progress details
Have a question?
Ask the Code Zone community.
Ask a question in The Code Zone (opens in a new tab)Continue learning

7 days freeTry The Code Zone
THE CODE ZONE COMMUNITY
Your next step is easier together.
Try the community free for 7 days.
No charge during your trial. Choose your plan on Skool.
- Ask questions and get support in the community
- Watch every course video walkthrough
- Find a study buddy in the 24/7 study room
Make the most of your trial with Premium.
Choose Premium on Skool to try Thursday live help sessions. Bring your questions, work through code, and get unstuck together.
Scheduled Thursdays in Eastern Time. Check the Skool calendar for your local date and time.
Have a website account? Sign in