Case scenario Your retail store manager has another issue. She accidentally combined sales records for in-store sales and sales for bulk goods at the local farmers market. She needs your help to separate numbers with decimals (i.e., sales plus sales tax) from numbers without decimals (i.e. tax-free sales at the farmers market) and run some calculations. Scotty and Peter, your store coworkers also need some help. Scotty manages the bear department and needs a quick way to create a list of orders. Peter manages the anteater department and for some reason, needs to order the same things as Scotty, along with his own department's items. In the monthly sales report, your manager needs to know the shortest item (in terms of number of characters) in Scotty's list and the longest item in Peter's list.
You're feeling good after learning some basic Python so you again offer to help your managers and now also your coworkers. First, help your manager Using Python code and logic, look at each number in sales. If the number contains a decimal, add it to a list called taxed. This list will contain all the sales from the store, which are taxed (thus the decimals). If the number does not contain a decimal, add it to a list called market. This list will contain all the sales from the farmers market, which is cash only and not taxed. Next, do some calculations on each list. Show your manager the AVERAGE sales amount from the taxed list. Show your manager the TOTAL sales amount from the market list. Print a helpful line of text to let your manager know that this is the end of the sales report, and that it is Scotty's and Peter's turn to use the program. The program will continue running, just imagine that your manager passes the laptop over to them.
Then, help your coworkers Scotty will enter his list first. You don't know how many things he needs to order, so let him enter items until he enters "x" without quotes. Store each item into a list called scotty. Once he enters "x" without quotes, stop letting him enter items. Do not store "x" into his list. Peter will enter his list second. You also don't know how many things he needs to order, so let him enter items until he enters "x" without quotes. Store each item into a list called peter. Once he enters "x" without quotes, stop letting him enter items. Do not store "x" into his list. Display everything in Scotty's list one at a time (i.e., do not just print the scotty list). Use Python logic to determine the shortest item (fewest number of characters) in Scotty's list, and display this information. Display everything in Peter's list one at a time (i.e., do not just print the peter list). Use Python logic to determine the longest item (most number of characters) in Peter's list, and display this information.
started code is : sales = [16, 72.43, 12, 85.87, 41, 75.77, 20, 11.24, 39, 23.06, 40, 32.91, 26, 40.46, 46, 59.0, 12, 43.72, 25, 22.25, 15, 51.57, 29, 31.6, 2, 66.21, 14, 89.3, 32, 81.66, 49, 80.35, 31, 21.09, 32, 56.75, 11, 22.91, 2, 12.22, 27, 49.47, 44, 60.19, 17, 34.77, 13, 64.82, 32, 59.63, 18, 27.2, 18, 23.41, 48, 63.92, 25, 37.31, 6, 46.29, 43, 51.7, 34, 31.49, 40, 71.15, 50, 59.53, 46, 56.5, 4, 97.21, 30, 25.44, 22, 60.71, 45, 47.52, 7, 35.53, 31, 77.12, 10, 31.92, 45, 55.1, 27, 44.85, 18, 38.0, 48, 80.49, 29, 95.09, 14, 50.83, 30, 66.16, 47, 54.2, 26, 70.35, 49, 74.05, 47, 25.1, 31, 68.0, 10, 29.34, 31, 5.89, 37, 30.4, 50, 97.81, 34, 29.16, 25, 21.97, 32, 27.15, 38, 97.43, 49, 21.18, 19, 4.62, 8, 41.25, 14, 7.3, 25, 92.6, 7, 25.29, 33, 18.62, 4, 17.13, 11, 24.22, 12, 34.53, 49, 56.22, 30, 86.43, 36, 25.41, 41, 97.92, 34, 42.59, 26, 1.6, 20, 4.05, 35, 81.78, 33, 63.45, 37, 23.96, 12, 61.77, 24, 79.01, 41, 69.08, 23, 37.54, 13, 52.47, 32, 13.4, 1, 18.6, 19, 31.73, 4, 68.55, 50, 62.04, 19, 41.22, 2, 82.92, 39, 62.24, 21, 88.53, 48, 94.58, 14, 85.66, 27, 27.95, 3, 20.54]