Skip to content

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.

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


num = input("Введите трехзначное число: ")

num1 = int(num[0])

Choose a reason for hiding this comment

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

Всё же решили использовать индексы массива. Что ж, пусть будет так.
Но потерять стрелочки в блок-схеме - это очень плохо.

@@ -0,0 +1,15 @@
# 5. Пользователь вводит две буквы. Определить, на каких местах алфавита они стоят и сколько между ними находится букв.
letters = input("Введите две строчные буквы английского алфавита: ")
letter1 = letters[0]

Choose a reason for hiding this comment

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

И снова массив )))

ord_letter_1 = ord(letter1) - ord_a + 1
ord_letter_2 = ord(letter2) - ord_a + 1

letters_between = abs(ord_letter_2 - ord_letter_1)

Choose a reason for hiding this comment

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

Между буквами a и d находятся b и c - две буквы. А у вас почему-то три.

@@ -0,0 +1,12 @@
# 6. Пользователь вводит номер буквы в алфавите. Определить, какая это буква.

ord_n = int(input("Введите порядковый номер буквы: "))

Choose a reason for hiding this comment

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

Отлично

l2 = int(input('Введите длину второго отрезка: '))
l3 = int(input('Введите длину третьего отрезка: '))

if l1 != 0 and l2 != 0 and l3 != 0 and (l1 + l2) > l3 and (l2 + l3) > l1 and (l3 + l1) > l2:

Choose a reason for hiding this comment

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

Сочетание l и !. У вас в глазах не пестрит? Блок-схему еле осилил прочитать )))

# 8. Определить, является ли год, который ввел пользователем, високосным или невисокосным.
year = int(input("Введите номер года: "))

if (year % 4) == 0:

Choose a reason for hiding this comment

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

Отлично.
Кстати, скобочки в условиях можно не писать )))

@@ -0,0 +1,21 @@
# 9. Вводятся три разных числа. Найти, какое из них является средним (больше одного, но меньше другого).
print('Введите три разных числа')

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