30.0k views
0 votes
Write a function called swatch that takes three arguments:

1. A start color,
2. An end color
3. A number of squares to generate.

1 Answer

6 votes

Answer:

def swatch (startColor, endColor, numOfSquares):

'''

documentation:

A description of what this function does

'''

return

Step-by-step explanation:

Using python programming language, we define the function called swatch and specify the parameters as required in the question. Functions are defined in python using the def keyword followed by the function's name then followed by the optional arguments list. The writing that appears between the ''' ''' is for the functions documentation, it provides a description of what the function does

User Ravi Matani
by
6.0k points