-
Notifications
You must be signed in to change notification settings - Fork 0
hw 1 #1
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
base: master
Are you sure you want to change the base?
hw 1 #1
Conversation
Dzhoker1
left a comment
There was a problem hiding this 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]) |
There was a problem hiding this comment.
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] | |||
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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("Введите порядковый номер буквы: ")) | |||
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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('Введите три разных числа') | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Отлично
No description provided.