Hi I am quite new to python and struggling with creating a for loop within a for loop. I want the bottom 3 lines to loop. Many thanks!
for restaurant in sorted_list:
wks_res.append_row([
restaurant["name"],
restaurant["rating"],
restaurant["user_ratings_total"],
restaurant['reviews'][0]['text'],
restaurant['reviews'][1]['text'],
restaurant['reviews'][2]['text'],
])
The way I tried it is as follows:
for restaurant in sorted_list:
wks_res.append_row([
restaurant["name"],
restaurant["rating"],
restaurant["user_ratings_total"],
for reviews in restaurant['reviews']:
reviews['text'],
])
append_rowspecifically need a list, or can it be an arbitrary iterable?