If I have the following list:
list_numbers = [{1:'one'},{2:'two'},{3:'three'}]
In order to access every item of the list I need to iterate it and then to access the key and value call.items() like:
for numbers in list_numbers:
for int_rep, str_rep in numbers.items():
print(f"{int_rep} is written as {str_rep}")
Ideally I would like to iterate just once and I imagine that the first for iteration already knows there will be a dict inside, something like flattening the list on the for loop? Note this code doesn't work!:
for int_rep,str_rep in *list_numbers:
print(f"{int_rep} is written as {str_rep}")