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

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 StoresNames which contains 5 furniture stores names:

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

b. A list of floats called StorePrices which contains the prices of queen mattresses offered by the stores above – respectively- :

199, 399, 499, 249, and 217.

2. 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.

b. 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).

c. Define a function called avg_price which receives 1 parameter (the StorePrices) and it returns back the average price.

d. 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 ************************************************************************
Powered by