Update c_02.py

This commit is contained in:
Bill Buchanan
2021-02-25 19:14:32 +00:00
committed by GitHub
parent 92a78f8cae
commit 14ce2ed5c6

View File

@@ -1,22 +1,19 @@
import sys
import random
p=11
def getG(p):
for x in range (1,p):
rand = x
exp=1
next = rand % p
rand = x
exp=1
next = rand % p
while (next <> 1 ):
next = (next*rand) % p
exp = exp+1
while (next != 1 ):
next = (next*rand) % p
exp = exp+1
if (exp==p-1):
print (rand)
if (exp==p-1):
print rand
print getG(p)
print (getG(p))