Skip to content

Instantly share code, notes, and snippets.

@tamert
Created September 9, 2020 19:22
Show Gist options
  • Save tamert/15bae8fdfb6fcda259d3d7e8f7d36bd8 to your computer and use it in GitHub Desktop.
Save tamert/15bae8fdfb6fcda259d3d7e8f7d36bd8 to your computer and use it in GitHub Desktop.
4_map.py
liste = [1,2,3,4]
def arttir(sayi):
return sayi *5+2
print(list(map(arttir, liste)))
# out: [7, 12, 17, 22]
# yada lambda terimi ile kullanalım
print(list(map(lambda sayi: sayi *5+2, liste)))
# out: [7, 12, 17, 22]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment