Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

infinite if inside a loop

Hi. I want to define a function that checks if a member of a set is another then print "well".

Let me explain it it the following example:

Assume that Z=Compositions(17 , min_part=4).list() , L is some set and f is some function. How I can write a function such that if f(a)m where a is a member of Z, was in L, then that is "well"?

My attempt: for i in in srange(len(Z)): for j in srange(i): if f(Z[i][j]) in L:

I don't know how to finish it because I just know finite if, else not not more. Thanks in advance,

infinite if inside a loop

Hi. I want to define a function that checks if a member of a set is another then print "well".

Let me explain it it the following example:

Assume that Z=Compositions(17 , min_part=4).list() , L is some set and f is some function. How I can write a function such that if f(a)m f(a), where a is a member of Z, was in L, then that is "well"?

My attempt: for i in in srange(len(Z)): for j in srange(i): if f(Z[i][j]) in L:

I don't know how to finish it because I just know finite if, else not not more. Thanks in advance,

infinite if inside a loop

Hi. I want to define a function that checks if a member of a set is another then print "well".

Let me explain it it the following example:

Assume that Z=Compositions(17 Z = Compositions(17, min_part=4).list(), min_part=4).list() , L L is some set and f f is some function. function.

How I can write a function such that if f(a), f(a), where a is a member of Z, Z, was in L, L, then that is "well"?

My attempt: attempt:

for i in in srange(len(Z)):
    for j in srange(i):
       if f(Z[i][j]) in L:

L:

I don't know how to finish it because I just know finite if, else else, not not more. Thanks in advance,more.

infinite if inside a loop

I want to define a function that checks if a member of a set is another then print "well".

Let me explain it it the following example:

Assume that Z = Compositions(17, min_part=4).list(), L is some set and f is some function.

How I can write a function such that if f(a), where a a is a member of Z, was in L, then that is "well"?

My attempt:

for i in in srange(len(Z)):
    for j in srange(i):
       if f(Z[i][j]) in L:

I don't know how to finish it because I just know finite if, else, not more.