Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
Loading…
Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
Loading…
Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
PYTHON STRUCTURES / CHAPTER 06 / Learn / LESSON 12
Capstone: clean, dedupe, rank.
records = [ {"name": " Ana ", "score": 8}, {"name": "Bo", "score": 9}, {"name": "ana", "score": 7}, ]
1) strip names, lowercase for comparison 2) keep best score per unique name 3) sorted by score desc, then name 4) print ranked lines "name score"
Structures Engine v1.
Capstone Structures Engine v1.
DATA LAUNCH STANDBY
›