The error is from trying to access a list like a dict.
you can use the list index to access the data or loop the list to get the data.
you can use the list index to access the data or loop the list to get the data.
com_str = [{'community_string': 'public'}, {'community_string': 'private'}] print('list index') print(f"{com_str[0]['community_string']} | {com_str[1]['community_string']}") print() print('looping') for data in com_str: print(data['community_string']) print() print('One liner') print('\n'.join([data['community_string'] for data in com_str]))
Output:list index
public | private
looping
public
private
One liner
public
private
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags