When I run the following code, I get the output below, which is correct:
for object in buck:
if object.url.startswith("https://....01fhekh01") \
or object.url.startswith("https://...01fkejrig05"):
print(object)
Output:
<Object url='https://....01fhekh01-fkjflekjl' etag='"ewjhwehroie30923r"'>
<Object url='https://.......01fkejrig05-fjkjefojeof' etag='"265af8a7a0b69d3c173d40916fc2c5eb"'>
However, when I print my output outside of the loop statement, I get a different output, which is wrong:
for object in buck:
if object.url.startswith("https://....01fhekh01") \
or object.url.startswith("https://...01fkejrig05"):
print(object)
print(object)
Output:
*correct output from the print inside the loop statement*
wrong output from the print outside of the loop statement:
<Object url='https://....kjwekjweijtoeirjtoeri' etag='"sfakjlakfjsf"'>
How can I print the correct output out of the loop statement?