Conversation
| print('Пока') | ||
| break | ||
| else: | ||
| print('Не верный знак!!!') No newline at end of file |
| return ChetNechet(n // 10, chet, nechet) | ||
|
|
||
| value = input('Введите натуральное число:') | ||
| print(ChetNechet(int(value))) No newline at end of file |
| number2 = number2 * 10 # увеличиваем разрядность второго числа | ||
| number2 = number2 + temp # добавляем очередную цифру | ||
|
|
||
| print('Обратное число:',number2) No newline at end of file |
There was a problem hiding this comment.
плюс за неиспользование массивов и операций с ними
| summa += a | ||
| a = a/-2 | ||
| i += 1 | ||
| print(sum) No newline at end of file |
| print() | ||
| print() | ||
|
|
||
| my_func() No newline at end of file |
| print('Искомое число меньше твоего') | ||
| elif a < random_number: | ||
| count -=1 | ||
| print('Искомое число больше твоего') No newline at end of file |
| if(sum == check): | ||
| print('Числа сходятся') | ||
| else: | ||
| print('Числа не сходятся') No newline at end of file |
There was a problem hiding this comment.
решено через цикл, но можно и рекурсию
| count += 1 | ||
| m = m // 10 | ||
|
|
||
| print("Было введено %d цифр %d" % (count, d)) No newline at end of file |
There was a problem hiding this comment.
конкатенация - зло
m = int(input("Число " + str(i) + " : "))
| count += 1 | ||
| m = m // 10 | ||
|
|
||
| print("Было введено %d цифр %d" % (count, d)) No newline at end of file |
There was a problem hiding this comment.
здесь тоже лучше исп-ть ф-строки
| else: | ||
| z += int(n % 10) | ||
| return Sum(n // 10, z) | ||
|
|
There was a problem hiding this comment.
как так??
разве пеп-8 разрешает такие имена? Sum??
https://pythonworld.ru/osnovy/pep-8-rukovodstvo-po-napisaniyu-koda-na-python.html#id26
кроме того, такое имя зарезервировано!!!!! sum()
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.