Answer the question
In order to leave comments, you need to log in
Why does the line slide to another place?
There is this
<td colspan="4" bgcolor="#6633FF">Физическая подготовка</td>
</tr>
<tr>
<td>Ученик</td>
<td>Рост (см)</td>
<td>Вес (кг)</td>
</tr>
<tr>
<td colspan="3">Упражнение</td>
<td>1</td>
<td>2</td>
</tr>
Answer the question
In order to leave comments, you need to log in
Your code is complete nonsense, the error is strung on the error, I see no reason to list them. This is roughly how it's done:
def partition(cap, lim):
if cap <= lim:
yield (cap,)
for head in range(min(cap - 1, lim), 0, -1):
for tail in partition(cap - head, head):
yield (head,) + tail
for p in partition(5, 5):
print('+'.join(map(str, p)))
List A has one element at the beginning. after A.pop() is called, the only element is removed, so while only does one iteration. and generally incorrect names of variables and a method. IMHO, this is more than a perversion to name variables and methods with the same letter
the longclaps solution is much better than this.
this is an attempt to come up with a code that could be written by a person who did not know map, yield, join and the concept of recursion
in other cases, use the longclaps solution
def elements(x):
result =
for element in result:
for j, number in enumerate(element):
if number > 1:
for i in range(1, int(number / 2) + 1):
copy = element[:]
del copy[j]
new_elem = sorted(copy + [i] + [number - i])
if new_elem not in result:
result.append(new_elem)
s = ''
for char in new_elem:
s += str(char)
print('+'.join(s))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question