[英]I am having trouble with a python syntax error
I need help as I was watching a video on how the cicada3301 puzzles were solved. 在观看有关如何解决cicada3301难题的视频时,我需要帮助。 One of them, I forgot which one, said that python could be used to find the two prime number which, when multiplied, will give the number. 其中一个,我忘记了哪一个,我说过python可以用来找到两个素数,当相乘时,将得出该数。 I tried copying down the code myself and testing it in python but I am confused on how I am supposed to run it and why I got that syntax error. 我尝试自己复制代码并在python中进行测试,但是我对应该如何运行它以及为什么会出现语法错误感到困惑。
Here is what the code looked like: 代码如下所示:
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
Here, It should x,y='value1','value2'
在这里,它应该x,y='value1','value2'
You have only given x,y='value1',
, what is y
? 您只给定了x,y='value1',
y
什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.