Skip to content

Lesson5 - #5

Open
iisat wants to merge 1 commit into
lesson4from
lesson5
Open

iisat wants to merge 1 commit into
lesson4from
lesson5

Conversation

@iisat

@iisat iisat commented Nov 13, 2018

Copy link
Copy Markdown
Owner

No description provided.

@Dzhoker1 Dzhoker1 left a comment

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 Lesson5/task1.py

for i in range(companies):
name = input('Имя компании: ')
q1 = int(input('Прибыль Q1: '))

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 Lesson5/task1.py
allprofit = 0

for i in range(companies):
allprofit += all_companies[i].q1 + all_companies[i].q2 + all_companies[i].q3 + all_companies[i].q4

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