+ 1

HELP!

I m not understanding why the 1st part of the compression do not work! https://code.sololearn.com/cRFWtmeBSplh/?ref=app

8th Aug 2018, 9:23 PM
Mohamed Sahnoun
Mohamed Sahnoun - avatar
7 Réponses
+ 2
1. range[8] needs to be range(8) 2. if requires a logical operation to evaluate, octet[i]=octet[i+1] is assignment, use double equal sign, ie. == to do an evaluation.
8th Aug 2018, 9:38 PM
JME
+ 2
I take it back you can do multiple assignments but it will save the same pointer in all of them so if you edit one all of them are changed.
8th Aug 2018, 9:46 PM
JME
+ 1
I can't do 8 assignments?
8th Aug 2018, 9:39 PM
Mohamed Sahnoun
Mohamed Sahnoun - avatar
+ 1
Look I fixed the 2 errors and it worked! But another one appeared!
8th Aug 2018, 9:46 PM
Mohamed Sahnoun
Mohamed Sahnoun - avatar
+ 1
it's because if i = 2, octet[i+7]= octet[9] which doesnt exist
8th Aug 2018, 9:49 PM
JME
0
I fixed it for the moment
8th Aug 2018, 10:04 PM
Mohamed Sahnoun
Mohamed Sahnoun - avatar
0
Thx for your help
8th Aug 2018, 10:04 PM
Mohamed Sahnoun
Mohamed Sahnoun - avatar