Skip to content

Instantly share code, notes, and snippets.

@ppaska
Created December 14, 2019 15:31
Show Gist options
  • Save ppaska/598d1d71d29398032531f7ca768c7493 to your computer and use it in GitHub Desktop.
Save ppaska/598d1d71d29398032531f7ca768c7493 to your computer and use it in GitHub Desktop.
JS Python sample gist
arr = [4, 9, 16]
def sqrt(a):
return Math.sqrt(a)
# use Array.map() with Python function
roots = arr.map(sqrt).join(",")
# use Array.map() or use arrow function
roots = arr.map(i => Math.sqrt(i)).join(",")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment