Question

popular_foods = {"Clam Chowder": {"Country": "United States", "Main Ingredients": ["clam", "onion", "celery", "potato", "carrot", "butter", "flour",...

popular_foods = {"Clam Chowder":
{"Country": "United States",
"Main Ingredients": ["clam", "onion",
"celery", "potato", "carrot",
"butter", "flour", "cream",
"red wine vinegar"]},
"Xiaolongbao":
{"Country": "China",
"Main Ingredients": ["flour", "pork",
"crab meat", "roe", "soy sauce",
"ginger", "rice wine",
"green onions"]},
"Feijoada":
{"Country": "Brazil",
"Main Ingredients": ["black beans",
"pork", "cabbage", "red peppers",
"onion", "tomato", "garlic"]},
"Ash Reshteh":
{"Country": "Iran",
"Main Ingredients": ["kidney beans",
"chickpeas", "navy beans",
"parsley", "spinach", "coriander",
"dill", "persian reshteh noodles",
"onions", "flour", "mint", "kashk",
"turmeric"]},
"Draniki":
{"Country": "Russia",
"Main Ingredients": ["potato", "onion",
"egg", "flour", "garlic"]},
"Ata Dindin":
{"Country": "Nigeria",
"Main Ingredients": ["palm oil",
"red bell pepper",
"scotch bonnet", "tomato",
"onion", "chicken stock",
"crayfish", "prawns", "mackerel"]}
}

dishes = []

for dish in popular_foods:
food_search = ["potato", "pork", "garlic"]
for food in food_search:
#Fill in blanks here
dishes.append(dish)
break

print(dishes)

What to fill in the blank??????

Homework Answers

Answer #1

IN THE GIVEN CODE THERE IS A BLANK, TO KNOW WHAT TO FILL IN IT , WE HAVE TO UNDERSTAND THE ABOVE LINE. WHERE IT IS A FOR LOOP

INSIDE ANOTHER FOR LOOP AS SHOWN

for dish in popular_foods:---------------------->IT IS ABOUT THE DISH IN TOTAL POPULAR FOODS
food_search = ["potato", "pork", "garlic"]
for food in food_search:------------>INSIDE FOOD SEARCH WE HAVE ALL THE MAIN INGREDIENTS. SO , WE NEED TO SELECT INGREDIENTS IN THAT FOOD SEARCH.

SO, NEXT LINE WILL BE A IF CONDITION TO CHECK WHETHER INGREDIENT IS THERE IN FOOD SEARCH OR NOT

THE MISSING LINE IS => if ingr in food_search:

HERE IN THIS PROGRAM WE ARE ADDING DISHES IF IT HAS INGREDIENTS THAT LISTED IN FOOD SEARCH , SO BEFORE THIS WE HAVE TO DECLARE THE ingr and assign some value to check it is in food search or not.

Thank you!

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT