Skip to content

tasks from lessons 1,2,4#272

Open
Kechkin wants to merge 1 commit into
masterfrom
kechkin
Open

tasks from lessons 1,2,4#272
Kechkin wants to merge 1 commit into
masterfrom
kechkin

Conversation

@Kechkin
Copy link
Copy Markdown
Collaborator

@Kechkin Kechkin commented Aug 23, 2020

No description provided.

Comment thread Practice/Kechkin/Pep8.py
hashname = self.generateName() + '.mp3'
self.map[hashname] = mp3
os.rename(path + '/' + mp3), path + '/' + hashname))
f = open(output, 'r') #пробелы убрать
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Много пробелов убирать?

Comment thread Practice/Kechkin/game.py

if __name__ == '__main__': # point for start
# for demonstration only
solder = Solder()
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Информация к размышлению. Подход к проектированию классов обычно такой: выделите аспекты приложения, которые могут изменяться, и отделите их от тех, которые всегда остаются постоянными. В данном случае у нас изменяются не сами персонажи, а их действия (в зависимости от подобранных предметов). Можно ли обойтись одним классом персонажа, сохраняя изменчивость действия?

Comment thread Practice/Kechkin/task1.py

def print_FizzBuzz():
for i in range(1, 101):
if i % 3 == 0:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Для числа 15 (которое делится и на 5, и на 3, и на 15) будет выведено и Fizz, и Buzz, и FizzBuzz, а ожидается только FizzBuzz.

Comment thread Practice/Kechkin/task2.py
# После чего,каждую цифру этого числа необходимо вывести в новой строке:

def number():
arr = list(str(int(input("Enter number of 5 digits: "))))
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Зачем столько преобразований? Строка->число->опять строка->список. Можно пробежаться и по элементам строки?

Comment thread Practice/Kechkin/task6.py


def matrix(num):
m = numpy.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Использование numpy, конечно, смотрится круто. Но на собеседовании 100% попросят решить средствами стандартной библиотеки.

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