Files
2025-09-13 14:39:22 +08:00

9 lines
180 B
Plaintext

def map_with_index ( func , lst ) : <EOL>
<INDENT>
res = [ ] <EOL>
for i , x in enumerate ( lst ) : <EOL>
<INDENT>
res . append ( func ( i , x ) ) <EOL>
<OUTDENT>
return res <EOL>