-
Notifications
You must be signed in to change notification settings - Fork 10
№22 #13
base: master
Are you sure you want to change the base?
№22 #13
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Из-за переименования файла с тестами homework/tests.py → homework/№22
, теперь они не запустятся (об этом сообщает pytest https://travis-ci.org/ItPeoplePython2018/lesson-1/builds/395512839)
return 0 | ||
|
||
def __init__(self, p1, p2): | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pass
больше не нужен - у нас уже появился код для метода __init__
pass | ||
def translate(fraze, dic): | ||
i = fraze.split() | ||
Num = len(i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Num
,Tran
,Translate
- не python-стиль. Стоит переименовать вnum
, т.к.CamelCase
закреплен за именами классов.- Не обязательно итерироваться по индексам элементов в списке, можно сразу по этим элементам итерироваться:
split_fraze = fraze.split()
for word in split_fraze:
tran.append(dic[word])
@@ -93,7 +105,7 @@ def test_is_prime(): | |||
""" | |||
|
|||
def is_prime(n): | |||
pass | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Без тела функции будет синтаксическая ошибка. Нужно либо pass вернуть, либо добавить код для фукнции.
@@ -72,7 +77,14 @@ def test_translate(): | |||
Документация по этому методу: https://docs.python.org/3/library/stdtypes.html#str.join | |||
""" | |||
def translate(fraze, dictionary): | |||
pass | |||
def translate(fraze, dic): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Второе объявление функции не нужно (речь о внутренней def translate(fraze, dic):
)
def translate(fraze, dictionary):
def translate(fraze, dic):
No description provided.