Notice: file_put_contents(): Write of 15945 bytes failed with errno=28 No space left on device in /var/www/tgoop/post.php on line 50
Proglib.academy | IT-курсы@proglib_academy P.2082
PROGLIB_ACADEMY Telegram 2082
✏️ Вопрос с реального собеседования по Python

Объясните, как работает функция map

map возвращает итератор, который применяет функцию к каждому элементу списка. Если нужно, его можно преобразовать в список:
def add_three(y):
return y + 3

li = [1, 2, 3]
list(map(add_three, li))
#=> [4, 5, 6]

В примере к каждому элементу списка добавляется 3.

#собес_academy
👍2



tgoop.com/proglib_academy/2082
Create:
Last Update:

✏️ Вопрос с реального собеседования по Python

Объясните, как работает функция map

map возвращает итератор, который применяет функцию к каждому элементу списка. Если нужно, его можно преобразовать в список:

def add_three(y):
return y + 3

li = [1, 2, 3]
list(map(add_three, li))
#=> [4, 5, 6]

В примере к каждому элементу списка добавляется 3.

#собес_academy

BY Proglib.academy | IT-курсы




Share with your friend now:
tgoop.com/proglib_academy/2082

View MORE
Open in Telegram


Telegram News

Date: |

Invite up to 200 users from your contacts to join your channel So far, more than a dozen different members have contributed to the group, posting voice notes of themselves screaming, yelling, groaning, and wailing in various pitches and rhythms. The initiatives announced by Perekopsky include monitoring the content in groups. According to the executive, posts identified as lacking context or as containing false information will be flagged as a potential source of disinformation. The content is then forwarded to Telegram's fact-checking channels for analysis and subsequent publication of verified information. Select: Settings – Manage Channel – Administrators – Add administrator. From your list of subscribers, select the correct user. A new window will appear on the screen. Check the rights you’re willing to give to your administrator. Polls
from us


Telegram Proglib.academy | IT-курсы
FROM American