Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

makeColors(colorLst,color) colorLst is a list of strings representing different colors color is a string representing a color Each color in the list is checked with

makeColors(colorLst,color)

colorLst is a list of strings representing different colors

color is a string representing a color

Each color in the list is checked with value of current element of the color string

If color is not the first color listed in the element from color list then a new color is

created concatenating color to the element from the color list

New colors are saved in a new color list

NOTE: makeColors MUST USE checkColor to determine if the color is in the first positions as described in checkColor above.

def checkColor(color1,color2): color1 = color1.upper() color2 = color2.upper() size = len(color1) if color1== color2[:size]: return True else: return False

This is the output in python please

image text in transcribed.

>>>makeColorsCC'BLUE',' Red-Green', 'Green-red, 'rEd C'red-blue "red-green-red'] >makeColorsCC' Green', 'Green-blue,' Green-red '1,' grEEn ") CI >>>makeColorsCC' Gred',' C'red-gred', "red-very", "red-blue'] bLUe , 'reD

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 14th East European Conference Adbis 2010 Novi Sad Serbia September 2010 Proceedings Lncs 6295

Authors: Barbara Catania ,Mirjana Ivanovic ,Bernhard Thalheim

2010th Edition

3642155758, 978-3642155758

More Books

Students also viewed these Databases questions

Question

Group Size and Communication

Answered: 1 week ago

Question

Understanding Group Roles

Answered: 1 week ago