Skip to content

lesson2 - #2

Open
b0rsh3c wants to merge 1 commit into
masterfrom
lesson2
Open

lesson2#2
b0rsh3c wants to merge 1 commit into
masterfrom
lesson2

Conversation

@b0rsh3c

@b0rsh3c b0rsh3c commented Jan 8, 2020

Copy link
Copy Markdown
Owner

No description provided.

Comment thread Lesson_2/1.py
print('Пока')
break
else:
print('Не верный знак!!!') No newline at end of file

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 Lesson_2/2.py
return ChetNechet(n // 10, chet, nechet)

value = input('Введите натуральное число:')
print(ChetNechet(int(value))) No newline at end of file

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 Lesson_2/3.py
number2 = number2 * 10 # увеличиваем разрядность второго числа
number2 = number2 + temp # добавляем очередную цифру

print('Обратное число:',number2) No newline at end of file

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 Lesson_2/4.py
summa += a
a = a/-2
i += 1
print(sum) No newline at end of file

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 Lesson_2/5.py
print()
print()

my_func() No newline at end of file

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 Lesson_2/6.py
print('Искомое число меньше твоего')
elif a < random_number:
count -=1
print('Искомое число больше твоего') No newline at end of file

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 Lesson_2/7.py
if(sum == check):
print('Числа сходятся')
else:
print('Числа не сходятся') No newline at end of file

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 Lesson_2/8.py
count += 1
m = m // 10

print("Было введено %d цифр %d" % (count, d)) No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

конкатенация - зло
m = int(input("Число " + str(i) + " : "))

Comment thread Lesson_2/8.py
count += 1
m = m // 10

print("Было введено %d цифр %d" % (count, d)) No newline at end of file

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 Lesson_2/9.py
else:
z += int(n % 10)
return Sum(n // 10, z)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

как так??
разве пеп-8 разрешает такие имена? Sum??
https://pythonworld.ru/osnovy/pep-8-rukovodstvo-po-napisaniyu-koda-na-python.html#id26

кроме того, такое имя зарезервировано!!!!! sum()

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