K
K
Konstantin Kavensky2017-06-22 18:14:38
Python
Konstantin Kavensky, 2017-06-22 18:14:38

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>

One and two should be exactly under "Exercise", in the case of the cell-heading "Physical training" everything turned out, but here is the layout going
CHYADNT?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
L
longclaps, 2018-11-21
@longclaps

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)))

And you should make efforts to master the basics of the language - there you are still doing poorly.

N
NaName, 2018-11-20
@NaName

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

A
andreyNN, 2018-11-21
@andreyNN

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))

M
Maxim, 2017-06-22
@Sonzanie

I guess what you need is something like this: jsfiddle

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question