Skip to content

Conversation

@psilentium
Copy link

No description provided.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

str(''.join([str(i) for i in a])) это масло масляное, ''.join([str(i) for i in a])это уже строка.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

''.join([str(i) for i in a]) это почти тоже самое, что и ''.join((str(i) for i in a)), что можно сократить до ''.join(str(i) for i in a)

@matklad
Copy link
Collaborator

matklad commented Apr 11, 2014

Больше пробелов

По PEP8 нужно ставить пробелы вокруг бинарных операторов: a + b а не a+b.

После запятых пробелы надо ставить всегда, даже в русском языке =)

Pycharm умеет делать реформат кода

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seq объявляется тут...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лучше вместо цикла записать

sum += sum(i for i in values if i > 0)

где первый sum это переменная, а второй -- та самая build-in функция

@matklad
Copy link
Collaborator

matklad commented Apr 11, 2014

В целом хорошо =)

  • Обратить внимание на работу с файлами(https://github.com/effect/bii-14s/blob/master/RECOMMENDATIONS.md)
    • Меньше глобальных переменных
    • Лучше использовать 'более функциональный' стиль -- писать функции, которые возвращают значения, а не функции-процедуры, которые изменяют аргументы/глобальные переменные

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants