python

常见错误:

' '.join(list): it need to guarantee the element of list is string,  so it it better it  strlist = ''.join(str(v) for v in list)

str.split(" ") just split a string using a " "   , str.split() will split the string using continuous space    equal to re.split("\s+",str)

dict  mp={}   mp.has_key(str)  judge whether the key is in mp?   mp.clear() 

list and tuple can be convented   list(tuple)  tuple(list)

 

 

pig and python 

bag   list(list or tuple)

tuple list or tuple

map  dict

 

posted @ 2014-09-05 16:52  purejade  阅读(141)  评论(0编辑  收藏  举报