Вот что у меня так далеко:
# A. match_ends
# Given a list of strings, return the count of the number of
# strings where the string length is 2 or more and the first
# and last chars of the string are the same.
# Note: python does not have a ++ operator, but += works.
def match_ends(words):
counter = 0
for word in words:
if len(word) >= 2 and word[0] == word[-1]:
counter += counter
return counter
# +++your code here+++
return
Я слежу за Google Python Class, так что это не домашняя работа, я просто учусь и совершенствуюсь; поэтому, пожалуйста, не оставляйте отрицательных комментариев по поводу «не делаю свою домашнюю работу». : P
Что вы, ребята, думаете, я здесь не так делаю?
Вот результат:
match_ends
X got: 0 expected: 3
X got: 0 expected: 2
X got: 0 expected: 1
Я действительно люблю Python, поэтому я просто знаю , что я стану лучше в этом. :)