Skip to content

Lesson 1#2

Open
alardis wants to merge 5 commits into
masterfrom
lesson_1
Open

Lesson 1#2
alardis wants to merge 5 commits into
masterfrom
lesson_1

Conversation

@alardis
Copy link
Copy Markdown
Owner

@alardis alardis commented Oct 8, 2019

Теперь добавлена проверка на корректность ввода.

Comment thread venv/lesson_1.py

hours_actual = int(seconds / 60 / 60)
mins_actual = int(seconds / 60) - hours_actual*60
seconds_actual = seconds - (hours_actual*60 + mins_actual) * 60
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 venv/lesson_1.py

item = ''
sum = 0
while len(item) < int(n):
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 venv/lesson_1.py
max = 0
count = 0
while count < len(number):
if int(number[count]) > max:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Это не арифметические операции

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 venv/lesson_1.py
costs = input('Вы ввели не число или оно не положительное. Давайте-ка повторим\n')
costs = int(costs)

if income > costs:
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