Conversation
luchanos
reviewed
Dec 29, 2020
| import sys | ||
| try: | ||
| print(int(sys.argv[1])*int(sys.argv[2])+int(sys.argv[3])) | ||
| except IndexError as err: |
| 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]] |
| # Для чисел в пределах от 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 |
| list.append(a) | ||
| i+=1 | ||
| print(f"Initial list:\n{list}") | ||
| new_list = [b for b in list if list.count(b) == 1] |
| def multiplier (el1, el2): | ||
| return el1*el2 | ||
|
|
||
| # hellofromhell = reduce(multiplier, list) |
| __color__ = "красный", "желтый", "зеленый" | ||
| def running(self): | ||
| print(f"Горит {TrafficLight.__color__[0]}") | ||
| time.sleep(7) |
There was a problem hiding this comment.
Можно запихнуть логику по временным пределам горения светофора в словарь) Это будет удобнее, загляни в разбор!)
| self.__length = length | ||
| self.__width = width | ||
|
|
||
| def calc_mass(self): |
There was a problem hiding this comment.
давай тут добавим параметр толщины и будем прокидывать его в функцию, как просят в условии
|
|
||
| class Position(Worker): | ||
| def get_full_name(self): | ||
| full_name = self.name + " " + self.surname |
| self.is_police = is_police | ||
|
|
||
| def go(self): | ||
| pass |
| pass | ||
|
|
||
| class TownCar(Car): | ||
| self.is_police = False |
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.