lesson 5#7
Open
serg0761 wants to merge 1 commit into
Open
Conversation
Dzhoker1
reviewed
Nov 11, 2018
|
|
||
| numbers_of_company = int(input('Введите количество компаний: ')) | ||
| if numbers_of_company == 0: | ||
| print('Работникам ПВО большой привет!') |
| for i in range(numbers_of_company): | ||
| company_name = (str(input(f'Введите название компании {i + 1}:'))) | ||
| year_summ = quarter_summ = 0 | ||
| for i in range(4): |
There was a problem hiding this comment.
for i in range(1, 5):
И как итог экономим несколько тактов процессора на +1 в строке 25.
Мелочь, а приятно )))
| full_summ = 0 | ||
| company = namedtuple('company','name, years_profit') | ||
|
|
||
| for i in range(numbers_of_company): |
There was a problem hiding this comment.
Если в этом цикле i, то во вложенном пишите j
|
|
||
| def input_numbers(): | ||
| num = str(input('Введите шестнадцатиричное число: ')) | ||
| numbers = list(deque(num)) #т.к. по условию задачи хранить |
There was a problem hiding this comment.
Речь шла о массиве.
В Python массивов нет. Зато есть list, tuple и deque, которые можно считать массивом с дополнительным функционалом.
| print('Последовательно введите два шестнадцатиричных числа') | ||
| first_number = input_numbers() | ||
| second_number = input_numbers() | ||
| summ_numbers = make_hexadecimal(read_numbers(first_number) + |
There was a problem hiding this comment.
Не совсем в столбик. Скорее даже в строку, а не в столбик.
Но работает верно.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.