Skip to content

Instantly share code, notes, and snippets.

@Deep18-03
Created April 25, 2020 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Deep18-03/83a7b26fd0f5cd81ebe6d7a503e96dc7 to your computer and use it in GitHub Desktop.
Save Deep18-03/83a7b26fd0f5cd81ebe6d7a503e96dc7 to your computer and use it in GitHub Desktop.
#map,filter,reduce
#lets take map -we can provide any function to list using map
lst=["2","3","4","5","6","7","8"]
num=list(map(int,lst))
print(num)
num1=list(map(lambda x:x*x,num))
print(num1)
# def square(x):
# """This function take one value and perform sqare of that number"""
# return x*x
# def cube(x):
# """this function take onme value and perform cube of that number"""
# return(x*x*x)
# fun=[square,cube]
# for i in range(5):
# num2=list(map(lambda x:x[i],fun))
# print(num2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment