Last active
October 9, 2018 05:53
-
-
Save svetlyak40wt/d9885585d70464cb202f1f2deaec83cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
names = ['bobuk', 'umputun', 'ksusha', 'gray'] | |
scores = [100500, 42, 777, 41] | |
list(map(print, names, scores)) | |
# так надо лямбда будет каждый раз последним аргументом, | |
# что наверняка неудобно в реализации | |
map(tuple, names, scores) | |
params = (names, scores) | |
list(map(print, *params)) | |
# а вот так уже не напишешь: | |
map(print, *params) | |
# А ещё, curring удобнее, когда лямбда первым параметром: | |
>>> from functools import partial | |
>>> printer = partial(map, print) | |
>>> list(printer(names, scores)) | |
bobuk 100500 | |
umputun 42 | |
ksusha 777 | |
gray 41 | |
[None, None, None, None] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment