Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

up #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

up #2

wants to merge 1 commit into from

Conversation

poluninatm
Copy link
Owner

No description provided.

Copy link

@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.

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

# то программа должна сообщать ему об ошибке и снова запрашивать знак операции.
# Также сообщать пользователю о невозможности деления на ноль, если он ввел 0 в качестве делителя.

sign = ""

Choose a reason for hiding this comment

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

Отлично

# 2. Посчитать четные и нечетные цифры введенного натурального числа.
# Например, если введено число 34560, то у него 3 четные цифры (4, 6 и 0) и 2 нечетные (3 и 5).

num = int(input('Введите натуральное число: '))

Choose a reason for hiding this comment

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

Отлично

# 3. Сформировать из введенного числа обратное по порядку входящих в него цифр и вывести на экран.
# Например, если введено число 3486, то надо вывести число 6843.

num = int(input('Введите целое положительное число: '))

Choose a reason for hiding this comment

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

Отличная работа

if num_input == num_rand:
print('Вы угадали')
break
else:

Choose a reason for hiding this comment

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

Можно заменить на elif для краткости и читаемости.

# 8. Посчитать, сколько раз встречается определенная цифра в введенной последовательности чисел.
# Количество вводимых чисел и цифра, которую необходимо посчитать, задаются вводом с клавиатуры.

def count_digit(num, digit):

Choose a reason for hiding this comment

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

Отлично

# Вывести на экран это число и сумму его цифр.


def get_num_sum(num):

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