Skip to content

Conversation

@alardis
Copy link
Owner

@alardis alardis commented Oct 8, 2019

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


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

Choose a reason for hiding this comment

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

А можно было через целочисленные деления и остатки ):)


item = ''
sum = 0
while len(item) < int(n):
Copy link

Choose a reason for hiding this comment

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

Можно без цикла, и код станет несколько понятнее

max = 0
count = 0
while count < len(number):
if int(number[count]) > max:
Copy link

Choose a reason for hiding this comment

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

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

Copy link

Choose a reason for hiding this comment

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

надо было работать не со строкой а именно с числом

costs = input('Вы ввели не число или оно не положительное. Давайте-ка повторим\n')
costs = int(costs)

if income > costs:
Copy link

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.

3 participants