advanced-features-functions/script.rst
changeset 410 226b6e789da5
parent 367 2ca9b21ed8f9
child 457 68813d8d80fb
equal deleted inserted replaced
409:43a24f7ab183 410:226b6e789da5
   167  
   167  
   168 
   168 
   169   welcome()
   169   welcome()
   170  
   170  
   171 
   171 
   172 Let us now learn what keyword arguments are. 
   172 Let us now learn what keyword arguments or named arguments are. We
       
   173 shall refer to them as keyword arguments, henceforth. 
   173 
   174 
   174 {{{ show a slide with examples using keyword arguments. }}}
   175 {{{ show a slide with examples using keyword arguments. }}}
   175 
   176 
   176 .. #[[Anoop: slide is missing]]
   177 .. #[[Anoop: slide is missing]]
   177 
   178 
   182   plot(y, sin(y), 'g', linewidth = 2)
   183   plot(y, sin(y), 'g', linewidth = 2)
   183 
   184 
   184   annotate('local max', xy = (1.5, 1))
   185   annotate('local max', xy = (1.5, 1))
   185 
   186 
   186   pie(science.values(), labels = science.keys())
   187   pie(science.values(), labels = science.keys())
   187 
       
   188 .. #[[Anoop: I think it will better to introduce keyword arguments as
       
   189    keyword/named arguments, as the keyword term was quite confusing
       
   190    for me, so can be for someone who already know certain
       
   191    jargon's/concepts, also it would be good to tell them that these
       
   192    are different from keywords in programming languages, explicit is
       
   193    better than implicit, and probably you could also tell them that
       
   194    from now on we will refer to it as just keyword arguments]]
       
   195 
   188 
   196 When you are calling functions in Python, you don't need to remember
   189 When you are calling functions in Python, you don't need to remember
   197 the order in which to pass the arguments. Instead, you can use the
   190 the order in which to pass the arguments. Instead, you can use the
   198 name of the argument to pass it a value. This slide shows a few
   191 name of the argument to pass it a value. This slide shows a few
   199 function calls that use keyword arguments. ``loc``, ``linewidth``,
   192 function calls that use keyword arguments. ``loc``, ``linewidth``,
   247   Math functions - abs, sin, ....
   240   Math functions - abs, sin, ....
   248 
   241 
   249 .. #[punch: Need to decide, exactly what to put here. Reviewer comments
   242 .. #[punch: Need to decide, exactly what to put here. Reviewer comments
   250 ..  welcome.] 
   243 ..  welcome.] 
   251   
   244   
   252 
       
   253 {{{ switch to slide showing classes of functions in pylab, scipy }}}
   245 {{{ switch to slide showing classes of functions in pylab, scipy }}}
   254 
   246 
   255 .. #[[Anoop: slide missing]]
   247 .. #[[Anoop: slide missing]]
   256 
   248 
   257 Apart from the standard library there are other libraries like ``pylab``,
   249 Apart from the standard library there are other libraries like ``pylab``,