0
How can I fix this error?!
My program is a bit compressor : For exemple, the user enter (10001101) the program output is (1302101) which means (1,triple0,two1,01). I have already a problem please check the program and see. https://code.sololearn.com/cRFWtmeBSplh/?ref=app
4 Respuestas
+ 3
User inputs 8 letters.
Maximum index is 7.
octet[i+7] tries to access index up to 22 because of your range(16).
octet[15+7] #out of range
Every single one goes out of range. Still with range(8).
octet[7+7] #out of range
octet[7 + 1] #out of range
+ 1
Normally it's range 8 (8 numbers in the bit) but I changed it because the error said out of range
0
Why is the range 16?
0
Oh yeah my bad thx!