Need help with this hw

I’m working on a Python exercise and need support.

Lab 8
Studying Nested Loops

Overview

This lab involves studying and explaining how nested loops work, both based on iteration loops and index-based loops.

Using lab zip folder

Download the zip folder for lab 8 Unzip it and study the code in lab8.py. Because colors is already defined for you, you may test out both functions using colors as an argument.

I ALL READY ATTACHED THE ZIP FILE WITH THIS QUESTION TAHNK YOU .

Questions

For the following, either answer the question or provide the requested code:

  1. color_match returns a list of pairs. How is each pair represented?
  2. If color_match is given a list of 9 colors, how many pairs does it produce? Show how you can calculate the answer.
  3. Write a modification of color_match and call it color_display so that it does the following:
    • Omits pairs that have the same color. For example, green green will no longer be a pair in the list.
    • Instead of returning the list, color_display prints each pair by hyphenating the pair. For example, green yellow will be printed as green-yellow.
  4. If color_display is given a list of 9 colors, how many pairs does it produce? Can you provide a general way of calculating that number?
  5. Note that color_blend uses index-based loops. Does it show blue-green and green-blue? Given the list of colors, can you always predict the order that the colors in a color pair will appear (e.g. will it be green-blue or blue-green).
  6. Can you predict how many unique pairs are produced from a list of 9? Do you have a general process for calculating that?
  7. Write a function called exotic_fruits that takes two parameters: a list of colors (represented as strings, e.g. the colors variable) and a list of fruits (represented as string, e.g. the fruits variable). The function should return a list of all possible exotic fruits that combine a color with a fruit (e.g. “blue melon”).
  8. If exotic_fruits is given x colors and y fruits, how many exotic fruits does it produce?

ALSO SEND THE EXAMPLE FOR LAB 4 IT SHOULD LOOKS LIKE THAT.