hausaufgabe--python 19- Functions 2

000-- define a function to check if a string is a symmatrical string

 

 

running result:

 

referred :

how to reverse a string: 

http://www.jb51.net/article/15700.htm

 

001--  define a function to count the passed parameters's amount of letters, digits, spaces, and other symbols 

 

count('I love DuoKai.reedy', 'I love you because who I am while I with you. wish we are the best1314.!@#$')

running result:

 

002-- functions in python 

in python, all the functions have something for return even there is no 'return' request in the code. the type for the non return function is 'None'

 

004-- you can return almost all the types for the functions .  By default, you need to put them in the tupple with ' , ' to separate them. 

 

005-- Do not use too much global values when it's not mandatory 

 

posted @ 2017-06-17 22:58  ReedyLi  阅读(261)  评论(0编辑  收藏  举报