Weird index error python
I'm creating a program that iterates through a text file and, starting at the beginning of a specific set of user credentials(of which i call "Cases"), and appropriately puts the username and password characters (in hexadecimal) into appropriate username and password arrays. although, however small, i'm getting a silly index error when iterating through the array. have i fallen off the array at the end? someone, please tell me what i'm doing wrong. here's the code: https://code.sololearn.com/chKP2oR0Fcfc This is what the notepad should look like: ------------------CASE 0: 0x4e 0x61 0x73 0x69 0x72 0x20 0x4d 0x75 0x68 0x61 0x6d 0x6d 0x61 0x64 UPASSWORD: 0x31 0x32 0x33 0x34 0x35 --END-- ------------------CASE 1: 0x4a 0x6f 0x68 0x6e 0x20 0x73 0x6d 0x69 0x74 0x68 UPASSWORD: 0x61 0x62 0x63 0x64 0x65 --END-- ------------------CASE 2: 0x6e 0x64 0x72 0x61 0x20 0x44 0x6f 0x72 0x6f 0x74 0x68 0x79 UPASSWORD: 0x78 0x79 0x7a ==END==