Erik,
Works perfectly, thanks much !!!
Mark, I am tied to data structure.
for address in addresses:
if isinstance(address, str):
apt = None
print(address, apt)
else:
address, apt = address
print(address, apt)
99 First Street None
33 Broadway Avenue Apt 303
1 P
All,
Can you have a phython list like:
['George',
'Soros',
['99 First Street',
'33 Broadway Avenue', ['Apt 303'],
'1 Park Avenue'],
'New York', 'NY']
In other words how do you correctly nest the
['Apt 303'] so it goes with 33 Broadway Avenue.
Also, I tried several ways and could not figure
Thanks to all who responded, it is a big help.
Tim, the 'crazy-other-result format' is the
result returned by the database, nothing
I can do about that :)
Thanks again
George
-Original Message-
From: Chris Angelico
Sent: Thursday, February 18, 2016 10:45 AM
Cc: python-list@python.or
Would this be the correct way to return
a list as a default result.
Also, would the list be the preferable result (to a python programmer) ?
def test(command, return_type='LIST'):
""" Go to database and return data"""
if return_type == 'LIST':
result = ['ONE', 'TWO', 'THREE']