摘要: 学习完string之后,现在来看看list的用法: 1 # -*- coding: cp936 -*- 2 #A. match_ends 3 # Given a list of strings, return the count of the number of 4 # strings where the string length is 2 or more and the first 5 # and last chars of the string are the same. 6 def match_ends(words): 7 count = 0 8 for item in... 阅读全文
posted @ 2013-03-30 18:03 Emma437211 阅读(368) 评论(0) 推荐(0) 编辑
摘要: 在string1之后继续推出string2:View Code 1 # -*- coding: cp936 -*- 2 # D. verbing 3 # Given a string, if its length is at least 3, 4 # add 'ing' to its end. 5 # Unless it already ends in 'ing', in which case 6 # add 'ly' instead. 7 # If the string length is less than 3, leave it uncha 阅读全文
posted @ 2013-03-30 12:12 Emma437211 阅读(267) 评论(0) 推荐(0) 编辑