Skip to content

Homework6#6

Open
facelli wants to merge 6 commits into
mainfrom
homework6
Open

Homework6#6
facelli wants to merge 6 commits into
mainfrom
homework6

Conversation

@facelli

@facelli facelli commented Dec 23, 2020

Copy link
Copy Markdown
Owner

No description provided.

import sys
try:
print(int(sys.argv[1])*int(sys.argv[2])+int(sys.argv[3]))
except IndexError as err:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

+++

list.append(a)
i+=1
print(f"Generated list:\n{list}")
mod_list = [list[item] for item in range(1, len(list)) if list[item] > list[item - 1]]

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 fourth lesson/3-d_task.py
# Для чисел в пределах от 20 до 240 найти числа, кратные 20 или 21. Необходимо решить задание в одну строку.
# Подсказка: использовать функцию range() и генератор.

print([a for a in range(20, 241) if a % 20 == 0 or a % 21 == 0]) # в одну строку %) 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.

+++

list.append(a)
i+=1
print(f"Initial list:\n{list}")
new_list = [b for b in list if list.count(b) == 1]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

+++

def multiplier (el1, el2):
return el1*el2

# hellofromhell = reduce(multiplier, list)

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 sixth_lesson/1-st_task.py
__color__ = "красный", "желтый", "зеленый"
def running(self):
print(f"Горит {TrafficLight.__color__[0]}")
time.sleep(7)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Можно запихнуть логику по временным пределам горения светофора в словарь) Это будет удобнее, загляни в разбор!)

self.__length = length
self.__width = width

def calc_mass(self):

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 sixth_lesson/3-rd_task.py

class Position(Worker):
def get_full_name(self):
full_name = self.name + " " + self.surname

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 sixth_lesson/4-th_task.py
self.is_police = is_police

def go(self):
pass

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 sixth_lesson/4-th_task.py
pass

class TownCar(Car):
self.is_police = False

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

очень сомнительно в данном случае)

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