Skip to content

lesson 5#7

Open
serg0761 wants to merge 1 commit into
lesson-1from
lesson-5.1
Open

lesson 5#7
serg0761 wants to merge 1 commit into
lesson-1from
lesson-5.1

Conversation

@serg0761
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

@Dzhoker1 Dzhoker1 left a comment

Choose a reason for hiding this comment

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

Оставил комментарии по коду

Comment thread 5.1.py

numbers_of_company = int(input('Введите количество компаний: '))
if numbers_of_company == 0:
print('Работникам ПВО большой привет!')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Почему именно ПВО? )))

Comment thread 5.1.py
for i in range(numbers_of_company):
company_name = (str(input(f'Введите название компании {i + 1}:')))
year_summ = quarter_summ = 0
for i in range(4):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

for i in range(1, 5):
И как итог экономим несколько тактов процессора на +1 в строке 25.
Мелочь, а приятно )))

Comment thread 5.1.py
full_summ = 0
company = namedtuple('company','name, years_profit')

for i in range(numbers_of_company):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Если в этом цикле i, то во вложенном пишите j

Comment thread 5.2.py

def input_numbers():
num = str(input('Введите шестнадцатиричное число: '))
numbers = list(deque(num)) #т.к. по условию задачи хранить
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Речь шла о массиве.
В Python массивов нет. Зато есть list, tuple и deque, которые можно считать массивом с дополнительным функционалом.

Comment thread 5.2.py
print('Последовательно введите два шестнадцатиричных числа')
first_number = input_numbers()
second_number = input_numbers()
summ_numbers = make_hexadecimal(read_numbers(first_number) +
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Не совсем в столбик. Скорее даже в строку, а не в столбик.
Но работает верно.

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.

2 participants