Преглед на файлове

Merge pull request #51 from dbojan/patch-4

Tried to simplify lambda explanation
Swaroop C H преди 9 години
родител
ревизия
3a57251ba1
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      more.md

+ 2 - 2
more.md

@@ -71,7 +71,7 @@ Notice that the single statement is used in-place and not as a separate block.
 
 ## Lambda Forms
 
-A `lambda` statement is used to create new function objects. Essentially, the `lambda` takes a parameter followed by a single expression only which becomes the body of the function and the value of this expression is returned by the new function.
+A `lambda` statement is used to create new function objects. Essentially, the `lambda` takes a parameter followed by a single expression. Lambda becomes the body of the function. The value of this expression is returned by the new function.
 
 Example (save as `more_lambda.py`):
 
@@ -83,7 +83,7 @@ Output:
 
 **How It Works**
 
-Notice that the `sort` method of a `list` can take a `key` parameter which determines how the list is sorted (usually we know only about ascending or descending order). In our case, we want to do a custom sort, and for that we need to write a function but instead of writing a separate `def` block for a function that will get used in only this one place, we use a lambda expression to create a new function.
+Notice that the `sort` method of a `list` can take a `key` parameter which determines how the list is sorted (usually we know only about ascending or descending order). In our case, we want to do a custom sort, and for that we need to write a function. Instead of writing a separate `def` block for a function that will get used in only this one place, we use a lambda expression to create a new function.
 
 ## List Comprehension