#neil3rd-python-index
1 messages · Page 1 of 1 (latest)
Hello
when executing stripe.Customer.list
along with
customers.data[0].name
I get the error >>> IndexError: list index out of range
How are you using customers.data[0].name?
Have you confirmed the data array is populated with any customers?
how do I confirm?
You can check its length, or just print its contents.
excluding print, how do I check via its length?
Have you tried something like this?
https://stackoverflow.com/questions/53513/how-do-i-check-if-a-list-is-empty
copy on this
last question before this thread can be achieved
this is a valid code >>> customers.data[0].balance
right?
Looks to be (assuming we're still talking about the same scenario)