Apr-07-2019, 06:38 PM
(This post was last modified: Apr-07-2019, 07:01 PM by DeadCthulhuWaitsDreaming.)
OK, this shouldn't be that hard but maybe I'm missing something.
This is the full function, the problem lies between the ###########################################################################s.
If anyone wants to see the full code I'll upload, but it seems pretty clear to me it's not the issue, but hell I'm a self taught coder so maybe I'm wrong. Someone please let me know if I'm doing something wrong or if it's a stupid bug and I should redo it in another coding language. Also I'm using Python 2.7.1 and the Idle IDE for windows 10.
Edit: Noticed a strange indentation in that exact section after uploading code, gonna go fix that quick.
Well I tried a change that should have done it but...
This is the full function, the problem lies between the ###########################################################################s.
If anyone wants to see the full code I'll upload, but it seems pretty clear to me it's not the issue, but hell I'm a self taught coder so maybe I'm wrong. Someone please let me know if I'm doing something wrong or if it's a stupid bug and I should redo it in another coding language. Also I'm using Python 2.7.1 and the Idle IDE for windows 10.
Edit: Noticed a strange indentation in that exact section after uploading code, gonna go fix that quick.
def GetCards(): commonList = []; uncommonList = []; rareList = []; common1 = ''; common2 = ''; common3 = ''; common4 = ''; common5 = ''; uncommon1 = ''; uncommon2 = ''; uncommon3 = ''; rare = ''; commonSet1 = ''; commonSet2 = ''; commonSet3 = ''; commonSet4 = ''; commonSet5 = ''; uncommonSet1 = ''; uncommonSet2 = ''; uncommonSet3 = ''; rareSet = ''; complete = 0; commonPrice1 = 0.00; commonPrice2 = 0.00; commonPrice3 = 0.00; commonPrice4 = 0.00; commonPrice5 = 0.00; uncommonPrice1 = 0.00; uncommonPrice2 = 0.00; uncommonPrice3 = 0.00; rarePrice = 0.00; maxValue = 0.00; packValue = 0.00; while complete != 2: complete = 0; #need to find how to get a username and match it to a name in a database #need to check if user has any spins before enabling the spin button #need to attach a paypal payment so user can add 1-2 more spins collection = importCollection(); for i in range(10): ########################################################################################################################################### print(collection[i].qty); <---- This outputs the correct values if collection[i].qty < 5: <---- This doesn't care print(len(collection)); <---- Never prints regardless of collection[i].qty ########################################################################################################################################## #for j in range(i + 1, len(collection)): #collection[j - 1] = collection[j]; #collection = collection[:1]; print(len(collection)); lngListCounter = 0 for lngRecordCounter in range(len(collection)): if collection[lngRecordCounter].rarity == 'C': commonList.append(collection[lngRecordCounter]); lngListCounter += 1; lngListCounter = 0 for lngRecordCounter in range(len(collection)): if collection[lngRecordCounter].rarity == 'U': uncommonList.append(collection[lngRecordCounter]); lngListCounter += 1; lngListCounter = 0 for lngRecordCounter in range(len(collection)): if collection[lngRecordCounter].rarity == 'R' or collection[lngRecordCounter].rarity == 'M': rareList.append(collection[lngRecordCounter]); lngListCounter += 1; print(commonList[2].name); print(len(commonList)); print(uncommonList[2].name); print(len(uncommonList)); print(rareList[2].name); print(len(rareList)); complete = 2;
Well I tried a change that should have done it but...
for i in range(10): num = collection[i].qty; print(num); <---- Again it prints the correct value so there is no uncertainty of what the if clause is looking for if num < 5: <---- Using num which has a set value still fails to trigger the if clause print(len(collection)); <---- Still never prints