Question: forecast _ string _ list PYTHON Given a forecast list for several days, create a forecast string list, You can use print
forecaststringlist PYTHON
Given a forecast list for several days, create a forecast string list,
You can use printstringlist in main to then print the forecast string list. parameters: forecastlist
sun example sunsunpartlycloudy","sun the example forecast list has data for 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 weathertemperature string
The forecast is for several days, maybe or
Each day of the forecast if thirteen rows or lines high.
Thus the forecast line string is also thirteen rows high
All rows are numberofdays characters wide
blank ro
weather
weather
weather
weather
ow
row
row
row
weather row
weather row
weather
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 daywsl
WLsl is day weather strings day weather strings day weather strings
TEMPERATURE
create an empty temperature list of string lists TLSI
for each day
append the day's temperature string list daytsl to the temperature list of string lists
TLS is day temp strings day temp strings day 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 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 rowstring, rowstring, rowstring, rowstring
REturn The forecast
don't forget to return the forecast string list forecast
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
