1. 学习
  2. /
  3. 课程
  4. /
  5. Practicing Coding Interview Questions in Python

Connected

练习

Define lambda expressions

Let's write some lambda expressions! You will be given three tasks: each will require you to define a lambda expression taking some values as arguments and using them to calculate a specific result.

说明 1 / 共 3 个

undefined XP
  • 1

    Take \(x\) and return \(x^2\) if \(x > 0\) and \(0\), otherwise.

  • 2

    Take a list of integers nums and leave only even numbers.

  • 3

    Take strings s1, s2 and list their common characters.