Skip to content

hw 1#1

Open
poluninatm wants to merge 1 commit into
masterfrom
hw1
Open

hw 1#1
poluninatm wants to merge 1 commit into
masterfrom
hw1

Conversation

@poluninatm
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

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

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

Comment thread task_1.py

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

num1 = int(num[0])
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 task_5.py
@@ -0,0 +1,15 @@
# 5. Пользователь вводит две буквы. Определить, на каких местах алфавита они стоят и сколько между ними находится букв.
letters = input("Введите две строчные буквы английского алфавита: ")
letter1 = letters[0]
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 task_5.py
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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

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

ord_n = int(input("Введите порядковый номер буквы: "))
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 task_7.py
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:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

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

if (year % 4) == 0:
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 task_9.py
@@ -0,0 +1,21 @@
# 9. Вводятся три разных числа. Найти, какое из них является средним (больше одного, но меньше другого).
print('Введите три разных числа')
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