-
Notifications
You must be signed in to change notification settings - Fork 0
Lesson05 #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Lesson05 #5
Conversation
Dzhoker1
left a comment
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.
Оставил комментарии по коду
| # всех предприятий) и отдельно вывести наименования предприятий, чья прибыль выше среднего и ниже | ||
| # среднего. | ||
|
|
||
| import collections |
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.
Отличный вариант решения
| for j in range(4): | ||
| prib = int(input('Введите прибыль за квартал №{0} '.format(j))) | ||
| ent[name].append(prib) | ||
| avg_arr = [sum(ent[x])/4 for x in ent] |
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.
Но не экономьте на пробелах.
| return counter | ||
|
|
||
| def get_hex_result(coll): | ||
| perenos = 0; res = "" |
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.
Привычки из других ЯП неискоренимы ;-)
| coll[i] = coll[i] % 16 | ||
| else: | ||
| perenos = 0 | ||
| res = hex(coll[i])[2:].upper() + res |
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.
Если придираться, то можно тут и ниже вставить текст задания "Примечание: Если воспользоваться функциями hex() и/или int() для преобразования систем счисления, задача решается в несколько строк. Для прокачки алгоритмического мышления такой вариант не подходит. Поэтому использование встроенных функций для перевода из одной системы счисления в другую в данной задаче под запретом."
Но не будем придираться. Работает отлично.
Выполнил