I have a cursor object in python. I wish to scrape that to a list.
names = []
address = []
for x in curs:
names.append(x["name"])
if (x["country"]=='USA'):
address.append(x["country"]+x["pincode"])
else:
address.append(x["country"])
this is the way I am iterating. Basically add pincode with country IFF country == USA. Else only country. Above piece works But, I wish to know same can be achieved in better/faster way. Right now it is comparing for in entry in curs the country.