Question SOLVED: In python Poblem Steps: 1. Inside the main function, define the following two lists:

\$30.00

Category:

Description

Question SOLVED: In python Poblem Steps: 1. Inside the main function, define the following two lists:

In python

Poblem Steps:

1. Inside the main function, define the following two lists:
a. A list of strings called StoresNameswhich contains 5 furniture stores names:

Wayfair, Ashley, Ford Furniture, Value City, and American Freight.

1. A list of floats called StorePriceswhich contains the prices of queen mattresses offered by the stores above – respectively- :

199, 399, 499, 249, and 217.

1. Now, define the following four functions:
a. Define a function called BelowThreeHundreds which receives 2 parameters -the two lists defined above- and it returns back a List of all the stores names that sell mattresses with price below \$300. The returned list should contain the names of all the stores in an upper case format only.
2. Define a function called long_names which receives 2 parameters (the two lists defined above) and it returns back a List of integers that represents the mattresses’ prices of stores that have long name (more than 10 characters).
3. Define a function called avg_price which receives 1 parameter (the StorePrices) and it returns back the average price.
4. Define a main function which defines the two lists above (in step 1) then it calls the three functions above (step 2 a,b,c) and finally it prints the results of the functions’ call as in the sample output below.

Sample run of the program:

************************************************************************ Stores which offer queen mattresses less than \$300: ************************************************************************ WAYFAIR

VALUE CITY
AMERICAN FREIGHT ************************************************************************ The prices of stores which has a long name: ************************************************************************ 499
217 ************************************************************************ The average price: 312.6 ************************************************************************

error: Content is protected !!