1. 学习
  2. /
  3. 课程
  4. /
  5. Intermediate Python for Developers

Connected

练习

Calling lambda in-line

Remember, one of the key benefits of lambda is the ability to use functions in-line.

In this exercise, you'll modify the approach of the previous exercise to calculate the total file size in-line without storing a lambda function as a variable first.

说明

100 XP
  • In a single line of code, make a lambda function that multiplies file_size by 1 + extra_space and returns the results.