intermediate
Refactor Code for Readability
Improve the structure and readability of a provided code snippet.
📝 Nội dung Prompt
Review the following code snippet and refactor it to improve readability and adhere to PEP 8 standards. Extract complex logic into smaller helper functions if necessary. Code: def proc(d,l): r=[]; [r.append((x*2) if x%2==0 else (x/2)) for x in l if x in d]; return r