What are higher-order functions

0 votes
How to pass functions as parameters?
Jun 12, 2019 in Python by Nisa
• 1,090 points
929 views

1 answer to this question.

0 votes

Higher-order functions are those functions that either take a function as a parameter or return it as an output. They can be user-defined functions or built-in functions for example map(), filter(), reduce(), etc.

EXAMPLE:

def newfunc(a):
    return a*a
x = map(newfunc, (1,2,3,4))  #x is the map object
print(x)
print(set(x))

OUTPUT: 

<map object at 0x00000284B9AEADD8>
{16, 1, 4, 9}

In [9]:

answered Jul 25, 2019 by Fata
• 1,050 points

Related Questions In Python

0 votes
1 answer

what are "and" and "or" operators in Python?

AND - True if both the operands ...READ MORE

answered Apr 18, 2018 in Python by Johnathon
• 9,090 points
851 views
0 votes
1 answer

What are the differences between type() and isinstance()?

To summarize the contents of other (already ...READ MORE

answered Jun 4, 2018 in Python by aryya
• 7,460 points
682 views
0 votes
2 answers

What are the types of dictionary in python?

There are 4 types of dictionary Empty Integer Mixed Dictionary with ...READ MORE

answered Feb 14, 2019 in Python by Shashank
• 1,370 points
1,018 views
0 votes
1 answer

What are the key features of Python?

If it makes for an introductory language ...READ MORE

answered Jul 20, 2018 in Python by Priyaj
• 58,020 points
640 views
+1 vote
1 answer

What is the correct order to learn concepts in Python for machine learning?

Machine Learning is a vast domain. It ...READ MORE

answered Jul 25, 2018 in Python by Abhi
• 3,720 points
1,058 views
0 votes
1 answer

What are the differences between type() and is instance()?

Normally, in Python, you want your code ...READ MORE

answered Aug 6, 2018 in Python by Priyaj
• 58,020 points
637 views
+1 vote
1 answer

What is the difference between range and xrange functions in Python 2.X?

xrange only stores the range params and ...READ MORE

answered Aug 22, 2018 in Python by Priyaj
• 58,020 points
2,393 views
0 votes
1 answer
0 votes
1 answer

what are sockets?

Sockets are basically open and close gateways ...READ MORE

answered Jun 25, 2019 in Python by Fata
• 1,050 points
710 views
0 votes
1 answer

What to do when I get and error saying python not recognized as internal or external command?

You need to set up the path ...READ MORE

answered May 28, 2019 in Python by Fata
• 1,050 points
2,466 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP