File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ function with a couple parameters pre-set.
1717Let's go back to the multiplier example we used when learning closures:
1818
1919``` 
20- 
2120     def multiplier(x):
2221         return x * 3
22+ 
2323``` 
2424
2525As before, we can use closures to create a multiplier factory, one that
@@ -39,6 +39,7 @@ This one would still be able to work in exactly the same way as the
3939original function, but now it also allows you to override the default
4040multiplication by 3 with a different factor:
4141
42+ 
4243``` 
4344
4445   multiplier(4) # The result will be 4 * 3 = 12
@@ -51,8 +52,8 @@ factor, even if it's not changing (unless the factor happens to have the
5152default value of 3). And there are places, like map that require a
5253function that takes only one argument!
5354
54- ..  container ::  section 
55-     :name:  real-world-example 
55+ Real-world-example 
56+ ------------------ 
5657
5758   What if I could create a function, on the fly, that had a
5859   particular factor “baked in”?
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments