Conversation
|
Hello @DoctorChe! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:
|
| print(f"Введено число {d3}{d2}{d1}") | ||
|
|
||
| print(f"Сумма цифр введённого числа = {d3 + d2 + d1}") | ||
| print(f"Произведение цифр введённого числа = {d3 * d2 * d1}") |
| print(f"Побитовая операция исключительное ИЛИ над числами 5 и 6: (5 ^ 6) = {5 ^ 6}") | ||
|
|
||
| print(f"Побитовый сдвиг влево над числом 5 на два знака: (5 << 2) = {5 << 2}") | ||
| print(f"Побитовый сдвиг вправо над числом 5 на два знака: (5 >> 2) = {5 >> 2}") |
| if b >= 0: | ||
| print(f"Уравнение прямой: y = {k}x + {b}") | ||
| else: | ||
| print(f"Уравнение прямой: y = {k}x - {b * -1}") |
| s = chr(abs(int(random() * (ord(s2) - ord(s1) + 1)) + ord(s1))) | ||
| else: | ||
| s = chr(abs(int(random() * (ord(s1) - ord(s2) + 1)) + ord(s2))) | ||
| print(f"Случайный символ в диапазоне от {s1} до {s2}: {s}") |
There was a problem hiding this comment.
да, здесь можно исп-ть встроенные ф-ции
|
|
||
| print(f"Первая буква находится на {s1 - first + 1}-м месте алфавита") | ||
| print(f"Первая буква находится на {s2 - first + 1}-м месте алфавита") | ||
| print(f"Между этими буквами находится {count} букв(а)") |
There was a problem hiding this comment.
работает отлично, в том числе и при обратном порядке букв
| # 6. Пользователь вводит номер буквы в алфавите. Определить, какая это буква. | ||
|
|
||
| s = int(input("Введте номер буквы в алфавите: ")) | ||
| print(f"Буква под номером {s} - это \"{chr(s + ord('a') - 1)}\"") |
There was a problem hiding this comment.
хорошо.
+, что везде исп-ся ф-строки
| elif (l1 == l2) or (l2 == l3) or (l1 == l3): | ||
| print("Треугольник является равнобедренным") | ||
| else: | ||
| print("Такого треугольника не существует") |
| if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0: | ||
| print(f"Год {year} является високосным") | ||
| else: | ||
| print(f"Год {year} не високосный") |
There was a problem hiding this comment.
отлично, вижу группировку условий
| elif b < a < c or b > a > c: | ||
| print(f"Средним является число {a}") | ||
| else: | ||
| print(f"Среди введённых чисел нет среднего числа") |
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.