[英]Can't use gcd function in python2.7
what is wrong here I tried to use gcd function but it give me this error but when I used floor and sqrt functions from math it works without any errors这里出了什么问题我尝试使用 gcd 函数但它给了我这个错误但是当我使用数学中的 floor 和 sqrt 函数时它可以正常工作没有任何错误
import math
from random import *
p=int(input("Enter p value"))
q=int(input("Enter q value"))
n=p*q
z=(p-1)*(q-1)
e=0
'''Select E Value'''
seed(1)
while(True):
Random_Value=randint(2,n)
if math.gcd(z,Random_Value)==1:
e=Random_Value
break
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.