Home>

On the waybreakI use two sentences, and I think that the first Break statement does not have problems, but the second BREAK statement is used only for missing FOR statements.

Is there no way to miss a wise for statement?

problem

It is determined whether the

n can be represented by the product of two integers of 1 or more and 9 or less.

N= 15;
CANDEVIDE= FALSE;
for I in Range (10):
  for m in Range (10):
    Result= i * M
    IF (n== result):
      CANDEVIDE= TRUE
      Print (str (i) + "" + str (m))
      break
  IF (CANDEVIDE):
    break
PRINT (CANDEVIDE)

I think Metropolis's Range (1, 10) is good. Class Range (START, STOP [ STEP]). docs.python.org/ja/3/library/...

mrrclb48z2021-05-04 01:24:16

Range (1, 9 + 1), Range (1, 1 + 9) Do you not write like this?

mrrclb48z2021-05-04 01:24:16

Certainly 0 did not make sense.

zunda2021-05-04 01:24:16