I am looping through a JSON dict to capture some data, I receive my expectant output, but too many times, where should either loop break to correctly capture the output? This out shows the formatted string more times than expected?
for dSr in lServiceRequests:
dListOfLa311ElectronicWaste = dSr["ListOfLa311ElectronicWaste"]
if("La311ElectronicWaste" in dListOfLa311ElectronicWaste):
lLa311ElectronicWaste = dListOfLa311ElectronicWaste["La311ElectronicWaste"]
for dla311ElectronicWaste in lLa311ElectronicWaste:
v_ewaste_item_count= dla311ElectronicWaste[K_ewaste_Item_Count]
dListOfLa311ElectronicWaste = dSr["ListOfLa311ElectronicWaste"]
if("La311ElectronicWaste" in dListOfLa311ElectronicWaste):
lLa311ElectronicWaste = dListOfLa311ElectronicWaste["La311ElectronicWaste"]
for dla311ElectronicWaste in lLa311ElectronicWaste:
v_ewaste_type = dla311ElectronicWaste[K_ewaste_type]
v_ewaste_item_info += '{0}, {1} '.format(v_ewaste_item_count, v_ewaste_type)
print v_ewaste_item_info
Output:
1, Cell Phone
1, Cell Phone 1, Computers
1, Cell Phone 1, Computers 2, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size)
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone 1, Copier/Scanner
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone 1, Copier/Scanner 4, Laptops/Tablets
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone 1, Copier/Scanner 4, Laptops/Tablets 4, Stereo/Speakers
1, Cell Phone
1, Cell Phone 1, Computers
1, Cell Phone 1, Computers 2, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size)
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone 1, Copier/Scanner
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone 1, Copier/Scanner 4, Laptops/Tablets
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone 1, Copier/Scanner 4, Laptops/Tablets 4, Stereo/Speakers
1, Cell Phone
1, Cell Phone 1, Computers
1, Cell Phone 1, Computers 2, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size)
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone 1, Copier/Scanner
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone 1, Copier/Scanner 4, Laptops/Tablets
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone 1, Copier/Scanner 4, Laptops/Tablets 4, Stereo/Speakers
1, Cell Phone
1, Cell Phone 1, Computers
1, Cell Phone 1, Computers 2, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size)
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone 1, Copier/Scanner
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone 1, Copier/Scanner 4, Laptops/Tablets
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone 1, Copier/Scanner 4, Laptops/Tablets 4, Stereo/Speakers
1, Cell Phone
1, Cell Phone 1, Computers
1, Cell Phone 1, Computers 2, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size)
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone 1, Copier/Scanner
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone 1, Copier/Scanner 4, Laptops/Tablets
1, Cell Phone 1, Computers 2, Cell Phone 2, Cell Phone 1, Laptops/Tablets 1, Cell Phone 2, TV (Any Size) 1, Cell Phone 2, Cell Phone 1, Cell Phone 1, Copier/Scanner 4, Laptops/Tablets 4, Stereo/Speakers