Unexpected TypeError when using `map` with a custom function in Python 2.7
I just started working with I'm working through a tutorial and I'm a bit lost with I'm working with a `TypeError` while using `map` in Python 2.7 with a custom function that is supposed to process a list of dictionaries... My function should take a dictionary and return a modified version of it, but I'm getting the following behavior: `TypeError: 'NoneType' object is not iterable`. Here is the function I am using: ```python def process_item(item): if 'value' in item: item['value'] *= 2 # Doubling the value return item items = [{'value': 10}, {'value': 20}, {'value': 30}] result = map(process_item, items) ``` When I run this code, I expect `result` to contain the modified dictionaries, but instead, I get the `TypeError`. I tried adding print statements inside `process_item` to debug, and I can see that the function is being called correctly, but the behavior still occurs. I also checked that my input list is not empty. I've never encountered this kind of behavior with `map` before. Any insights into why this might be happening or how I can fix it? I'd be grateful for any help. This is for a mobile app running on Ubuntu 20.04. What would be the recommended way to handle this? I'm coming from a different tech stack and learning Python. What are your experiences with this?