Question: forecast _ string _ list PYTHON Given a forecast list for several days, create a forecast string list, You can use print

forecast_string_list PYTHON
"""Given a forecast list for several days, create a forecast string list,
You can use print_string_list in main to then print the forecast string list. parameters: forecast_list
["sun","80"]] example [["sun","75"],["sun","70"],["partly_cloudy","68"],["sun","79"], the example forecast list has data for 5 days
Blank line, weather symbols for all days, blank line, temps for all days, blank line
Each string of a symbol or temperature should be padded on either side with a space Each day of the forecast has a weather symbol on top and a temperature below.
Each day of the forecast is fourteen characters wide, note twelve!
There is a space to the left and right of each weather/temperature string
The forecast is for several days, maybe \(2,3,4,5\), or 6
Each day of the forecast if thirteen rows or lines high.
Thus the forecast line string is also thirteen rows high
All 13 rows are 14* number_of_days characters wide
blank ro
weather
weather
weather
weather
ow
row 1
row 2
row 3
weather row 3
weather row 4
weather 5
blank row
temp row
temp row
temp row
temp row
Here is one possible algorithm for this function.
Blank Row
WEATHER
create an empty weather list of string lists (WLsl)
each day
create a weather string list for that day (day_wsl)
WLsl is [[ day 0 weather strings ],[ day 1 weather strings ],[ day 2 weather strings ],...
TEMPERATURE
create an empty temperature list of string lists (TLSI)
for each day
append the day's temperature string list (day_tsl) to the temperature list of string lists
TLS1 is [[ day 0 temp strings ],[ day 1 temp strings ],[ day 2 temp strings ],
FORECAST
create an empty forecast string list (forecast)
append a blank row to the forecast string list (forecast)
append a blank row to the forecast string list (forecast)
for each i'th row of 5 temperature rows
concatenate to end of line: one space, that day's
row i), one space
append the line to the forecast string list (forecast)
forecast is [ row_0_string, row_1_string, row_2_string, ..., row_12_string ]
REturn The forecast
don't forget to return the forecast string list (forecast)
forecast _ string _ list PYTHON " " " Given a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!