Open
Conversation
Dzhoker1
reviewed
Dec 19, 2018
|
|
||
| num = input("Введите трехзначное число: ") | ||
|
|
||
| num1 = int(num[0]) |
There was a problem hiding this comment.
Всё же решили использовать индексы массива. Что ж, пусть будет так.
Но потерять стрелочки в блок-схеме - это очень плохо.
| @@ -0,0 +1,15 @@ | |||
| # 5. Пользователь вводит две буквы. Определить, на каких местах алфавита они стоят и сколько между ними находится букв. | |||
| letters = input("Введите две строчные буквы английского алфавита: ") | |||
| letter1 = letters[0] | |||
| 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.
Между буквами a и d находятся b и c - две буквы. А у вас почему-то три.
| @@ -0,0 +1,12 @@ | |||
| # 6. Пользователь вводит номер буквы в алфавите. Определить, какая это буква. | |||
|
|
|||
| ord_n = int(input("Введите порядковый номер буквы: ")) | |||
| 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.
Сочетание l и !. У вас в глазах не пестрит? Блок-схему еле осилил прочитать )))
| # 8. Определить, является ли год, который ввел пользователем, високосным или невисокосным. | ||
| year = int(input("Введите номер года: ")) | ||
|
|
||
| if (year % 4) == 0: |
There was a problem hiding this comment.
Отлично.
Кстати, скобочки в условиях можно не писать )))
| @@ -0,0 +1,21 @@ | |||
| # 9. Вводятся три разных числа. Найти, какое из них является средним (больше одного, но меньше другого). | |||
| print('Введите три разных числа') | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.