Conversation
| n_fruits = len(fruits) | ||
| i=0 | ||
| while i < n_fruits: | ||
| print ('%d %s' % ((i+1), fruits[i])) |
| list2 =[1, 2, 4, 5, 6, 2, 5, 2] | ||
| l1 = set(list1) | ||
| l2 = set(list2) | ||
| list1a = list(l1 - l2) |
There was a problem hiding this comment.
Потеряешь повторяющиеся элементы тут. Если в list1 будет [1, 1], то на выходе только [1] получишь
There was a problem hiding this comment.
Но круто, что нашёл, что так можно через set сделать)
| date = '-2.10.3001' | ||
|
|
||
| #======================================================================= | ||
| # Задачу не понял, не ясно по какому правилу приводить месяц в диапазон от1 до 12 |
There was a problem hiding this comment.
не, имеется в виду, что в строке с месяцами может быть что-то вроде "01" и это приводится к 1
| b = '%3.3f' %a | ||
| c = b.split('.') | ||
| decimal_part = int(c[1]) | ||
| if (decimal_part == 0): |
There was a problem hiding this comment.
Интересное решение тоже, спасибо) сегодня посмотрим, как можно было немного проще сделать) Но всё правильно
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.
Не решена задача 2 из hard.py, я не понял ее условия. Также не решена задача 3 тоже из hard.py
Идеи есть, но если пытаться их реализовывать, то не успею сдать ничего...
И полный кошмар с smsrt-git'ом :о( с ветками и здесь они не lesson2 не выделяется отдельно, и у меня на компьютере все файлы свалены в кучу локальной ветки 'master', новая папка при создании ветки lesson2 и при иных более ранних попытках не образуется.. И по уроки просмотрел и ваше методичку прочитал не по одному разу.