It looks like you are trying to find two prime numbers that add up to an even number x. Here's the corrected code:

b = []
c = []

for m in range(2, y+1):
    n = x - m
    e = m // 2
    f = n // 2
    for i in range(2, e+1):
        if m % i == 0:
            b.append(i)
    if len(b) < 1:
        for j in range(2, f+1):
            if n % j == 0:
                c.append(j)
        if len(c) < 1:
            print("The two prime numbers that add up to " + str(x) + " are " + str(m) + " and " + str(n))

Please note that the variables x and y need to be defined before this code block for it to work properly.

b = c = for m in range2y+1n = x - me = m 2f = n 2for i in range2e+1if m i == 0bappendiif lenb 1for j in range2f+1if n j == 0cappendjif lenc1print组成偶数+strx+的两个质数是+strm+和+strn

原文地址: https://www.cveoy.top/t/topic/i4Hk 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录