我正在观看视频,了解cicada3301谜题是如何解决的。其中一个,我忘了哪一个,说python可以用来找到两个素数,当乘以时,它将给出数字。我尝试自己复制代码并在python中测试它,但我对如何运行它以及为什么我遇到语法错误感到困惑。
这是代码的样子:
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 07:18:10) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> def goldbach_conj(number):
x, y = '74674927695793569672701974404037902831935259177874331197231759008957255433116469469882489015469125000179524189783 result = 0 15469125000179524189783',
if not number % 2:
prime_list=list_of_primes(number)
while result != number:
for i in range(len(prime_list)):
x = prime_list[i]
if result == number:
break
for j in range(len(prime_list)):
y = prime_list[j]
result = x + y
print("Adding {} and {}.".format(x, y))
print("Result is {}".format(result))
if result == number:
break
return x, y
答案 0 :(得分:1)
这里应该x,y='value1','value2'
您只提供了x,y='value1',
,什么是y
?