Skip to content

Latest commit

 

History

History
27 lines (24 loc) · 472 Bytes

File metadata and controls

27 lines (24 loc) · 472 Bytes

Test case: arrow function to python lambda

JavaScript:

const squares = numbers.map(num => num * num);

Python:

squares = numbers.map(lambda num: num * num)

Test case: long arrow function to python local function

JavaScript:

const squares = numbers.map(num => {
    const tmp = num * num
    return tmp;
});

Python:

def local_anonymous_func(num):
    tmp = num * num
    return tmp
squares = numbers.map(local_anonymous_func)