摘要: 直接上代码:#encode:u8import res1 = 'adkkdk'#判断s1字符串是否负责都为小写的正则an = re.search('^[a-z]+$', s1)if an: print 'yes'else: print 'no' 阅读全文
posted @ 2015-09-24 11:19 CodeTracker 阅读(16437) 评论(0) 推荐(0) 编辑
摘要: 直接上代码:colours = ["red","green","blue"]for colour in colours: print colour# red# green# blue第二种方法colours = ["red","green","blue"]for i in range(0, l... 阅读全文
posted @ 2015-09-24 11:11 CodeTracker 阅读(417) 评论(0) 推荐(0) 编辑
摘要: 直接上代码my @array = ( 'a', 'b', 'c', 'a', 'd', 1, 2, 5, 1, 5 ); my %count; my @uniq_times = grep { ++$count{ $_ } < 2; } @array; 阅读全文
posted @ 2015-09-24 10:58 CodeTracker 阅读(1595) 评论(0) 推荐(0) 编辑