Recipe 1.1. Processing a String One Character at a Time(Python Cookbook)

it2022-05-08  6

set 1  >>>   import  sets 2  >>>  magic_chars  =  sets.set( ' abracadabra ' ) 3  >>>  magic_chars  =  sets.Set( ' abracadabra ' ) 4  >>>  poppins_chars  =  sets.Set( ' supercalifragilisticexpialidocious ' ) 5  >>>   print   '' .join(magic_chars  &  poppins_chars) 6  acrd

 

1  >>>   def  fun(c): 2       print  c 3       4  >>>  map(fun,  " abc " ) 5  a 6  b 7  c 8  [None, None, None]

 

 

转载于:https://www.cnblogs.com/zhtf2014/archive/2010/12/15/1907296.html

相关资源:垃圾分类数据集及代码

最新回复(0)