-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
homework lesson 3 Fadeev #8
base: main
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,26 @@ | |||
def num_translate(num_dict: dict, num: str) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не нужно менять аргументы функции в исходном задании value: str
for i in range(0, len(names), 1): | ||
key_list.append(names[i][0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
если уж завязались на такие манипуляции, то можно было посмотреть в сторону оптимизации через lambda
и map
if key_list[i] == key_list[i + 1]: | ||
key_list.remove(key_list[i + 1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
забыли метод .setdefault()
с вебинара?
noun = nouns[randint(0, len(nouns) - 1)] | ||
adverb = adverbs[randint(0, len(adverbs) - 1)] | ||
adjective = adjectives[randint(0, len(adjectives) - 1)] | ||
joke_list.append(' '.join([noun, adverb, adjective])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
можно было сделать в одну строку, используя choice
из random
Домашняя работа по 3-му уроку Фадеев Е.В., задания 1, 3, 5