Skip to content

Lesson2 - #1

Open
SRytv wants to merge 3 commits into
masterfrom
lesson2
Open

Lesson2#1
SRytv wants to merge 3 commits into
masterfrom
lesson2

Conversation

@SRytv

@SRytv SRytv commented Sep 10, 2018

Copy link
Copy Markdown
Owner

Не решена задача 2 из hard.py, я не понял ее условия. Также не решена задача 3 тоже из hard.py
Идеи есть, но если пытаться их реализовывать, то не успею сдать ничего...

И полный кошмар с smsrt-git'ом :о( с ветками и здесь они не lesson2 не выделяется отдельно, и у меня на компьютере все файлы свалены в кучу локальной ветки 'master', новая папка при создании ветки lesson2 и при иных более ранних попытках не образуется.. И по уроки просмотрел и ваше методичку прочитал не по одному разу.

Comment thread SRhw02_easy.py
n_fruits = len(fruits)
i=0
while i < n_fruits:
print ('%d %s' % ((i+1), fruits[i]))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

смотри help('FORMATTING')

Comment thread SRhw02_easy.py
list2 =[1, 2, 4, 5, 6, 2, 5, 2]
l1 = set(list1)
l2 = set(list2)
list1a = list(l1 - l2)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Потеряешь повторяющиеся элементы тут. Если в list1 будет [1, 1], то на выходе только [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.

Но круто, что нашёл, что так можно через set сделать)

Comment thread SRhw02_hard.py
date = '-2.10.3001'

#=======================================================================
# Задачу не понял, не ясно по какому правилу приводить месяц в диапазон от1 до 12

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

не, имеется в виду, что в строке с месяцами может быть что-то вроде "01" и это приводится к 1

Comment thread SRhw02_normal.py
b = '%3.3f' %a
c = b.split('.')
decimal_part = int(c[1])
if (decimal_part == 0):

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