GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.hackerrank.com — Map and Lambda Function | HackerRank We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies. Let's learn some new Python concepts! You have to generate a list of the first fibonacci numbers, being the first number. Then, apply the map function and a lambda expression to cube each fibonacci number and print the list. Concept The
Lambda is a single expression anonymous function often used as an inline function. In simple words, it is a function that has only one line in its body. It proves very handy in functional and GUI programming.
Note: Lambda functions cannot use the return statement and can only have a single expression. Unlike def, which creates a function and assigns it a name, lambda creates a function and returns the function itself. Lambda can be used inside lists and dictionaries. Input Format One line of input: an integer . Constraints
Output Format A list on a single line containing the cubes of the first fibonacci numbers. Sample Input Sample Output Explanation The first fibonacci numbers are , and their cubes are . Cookie support is required to access HackerRankSeems like cookies are disabled on this browser, please enable them to open this website |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |