Your question is Parse Key-Value String Map. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given a string data containing key-value pairs in the form key=value separated by semicolons, write a function that parses the string and returns a dictionary mapping each key to its value. Ignore malformed entries that do not contain exactly one = or that have an empty key. If a key appears multiple times, keep the last value.
;= and a non-empty keydef parse_kv_data(data):