I can't figure out where the jamb is.(Google Translate)
I can't figure out where the jamb is. First comes the working code (Looks for the maximum prime divisor of X), but I don't like the crutch marked # 707. Tried to fix it in 2 code on the line marked # 999, but it throws an error, because of the variable n, which exceeds the maximum index of the ho list. def mdl(x): ho=[] for i in range(x): if x%(i+2)==0: ho.append(i+2) for n in range(x): for i in range(x): if n <= len(ho)-1: #707 if ho[n]%(i+2)==0 and i+2!=ho[n]: ho.remove(ho[n]) print(max(ho)) =================================== def mdl(x): ho=[] for i in range(x): if x%(i+2)==0: ho.append(i+2) for n in range(len(ho)-1): for i in range(x): if ho[n]%(i+2)==0 and i+2!=ho[n]: #999 ho.remove(ho[n]) print(max(ho))