hausaufgabe--python 20-Closure functions 2

000-- to calculate specific letters in a string

 

 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 There is error for above codes 

Reffered:the path to open a file: http://www.cnblogs.com/xubing-613/p/6260346.html

to statistic the specific in the string: http://blog.csdn.net/granton/article/details/38664579

 

Standar answer: -_-|| so short......

 

 

 

001-- to change the global value in the closure function, use " global "

 

 

 002-- to change the same varial in another function, use "nonlocal"

 

 

003-- nested functions:

 

 

 

updated to :

 

 

004-- to access the inner functions

 

 

 

 

005 -- define a function, to find the small case letter which have 3 upper letter before and after it. 

 

 

 

 

running result:

 

posted @ 2017-06-21 10:26  ReedyLi  阅读(275)  评论(0编辑  收藏  举报