ما هو حل الخطأ IndexError: list index out of range في بايثون؟
السلام عليكم، عند تنفيذ الدالة التالية يظهر لي خطأ.
def decrypt(self,block):
roundkeys = []
state = string2number(block)
for i in range(1, 31):
state = addRoundKey(state, roundkeys[-i-1])
state = pLayer_dec(state)
state = sBoxLayer_dec(state)
decipher = addRoundKey(state, roundkeys[0])
return number2string_N(decipher,8)
الخطأ الذي يظهر:
state = addRoundKey(state, roundkeys[-i-1])
IndexError: list index out of range