How do I solve TypeError: pow() takes exactly 2 arguments (3 given)?
How do I solve TypeError: pow() takes exactly 2 arguments (3 given)?
我做了一个可以解决RSA数学问题的小程序。程序的一部分检查是否需要密文,如果需要明文,则给出e和n。
执行代码时出现错误:
TypeError: pow() 恰好接受 2 个参数(给定 3 个)
尽管 pow() 可以接受 3 个参数 https://www.programiz.com/python-programming/methods/built-in/pow
if "ciphertext" in NeededObjDict and "plaintext" in GivenObjDict and "e" in GivenObjDict and "n" in GivenObjDict:
OutputCiphertext = str(pow(GivenPlaintext, GivenE, GivenN))
print('ciphertext = ',OutputCiphertext)
我做了一个可以解决RSA数学问题的小程序。程序的一部分检查是否需要密文,如果需要明文,则给出e和n。
执行代码时出现错误: TypeError: pow() 恰好接受 2 个参数(给定 3 个) 尽管 pow() 可以接受 3 个参数 https://www.programiz.com/python-programming/methods/built-in/pow
if "ciphertext" in NeededObjDict and "plaintext" in GivenObjDict and "e" in GivenObjDict and "n" in GivenObjDict:
OutputCiphertext = str(pow(GivenPlaintext, GivenE, GivenN))
print('ciphertext = ',OutputCiphertext)