The part of the code that produced the error
def modinverse(a,26):
for x in range(0,26):
if(((a&)*(b&))& == 1):
return x
return -1
print(modinverse(a,26))
Here is the error I got
File "main.py", line 51
def modinverse(a,26):
^
SyntaxError: invalid syntax
I checked,it looks good. The spellings are fine, brackets and stuff are closed, I don't know what to do. I can't see what's gone wrong. I ran this on replit.
CodePudding user response:
Maybe def modinverse(a,26)
should be something like def modinverse(a,b)
or def modinverse(a,b=26):
?
In the first case you are declaring a parameter with the name 26
.