I am very new to python.
I researched about my problem but couldn't get the excepted answer.
What I don't understand here is how is myfunc
being called as it has no parameters like myfunc()
and how is argument (n)
taking two arguments(apple and banana)?
def myfunc(n):
return len(n)
x = list(map(myfunc,('apple', 'banana')))
print(x)
output:
[5,6]