Profile PictureTop Solutions Stop!

Python Cookie

$9.99
0 ratings

It is eight years from now, and you have a daughter in the Girl Scouts named Kate, who has been going around selling cookies for a fundraiser in her new self-driving car. You realize that instead of recording numbers of each type of cookie she sold, Kate just wrote the type of cookie every time she sold a box. You want to write a function def Cookies(cookieList): that converts a list of cookies into a dictionary where the key is the type of cookie and the value is the number of boxes of that cookie sold. The function should return the constructed dictionary.For example, the function call Cookies(["Oreos", "Tagalongs", "Oreos", "Oatmeal", "Oreos", "Thin Mints", "Samoas"]) will return:{'Oreos': 3, 'Tagalongs': 1, 'Oatmeal': 1, 'Thin Mints': 1, 'Samoas': 1}Because you are a competitive parent, you will not stand for anything less than perfection from your daughter. Therefore, if Kate has sold less than five types of cookies, you should print "Sell more cookies Kate, right away!”.

Add to cart
Size
1.49 KB
Copy product URL
$9.99

Python Cookie

0 ratings
Add to cart