Question: Here is a function that which simulates the weather outcome, due to a forecast model and by using a random number ( see Module 1
Here is a function that which simulates the weather outcome, due to a forecast model and by using a random numbersee Module on random number generator:
from random import
def simweather:
forecast random # generate a fractional number from to with even distribution
if forecast :
return "Sunny"
elif forecast :
return "Partly Cloudy"
elif forecast :
return "Showers"
else:
return "Thunder Showers"
If the program is run repetitively for a very larger number of times, say in thousands, list the forecast outcomes in the order of total occurrence of each from the highest to the lowest, Hint: youDonthave to run the program to find the answer
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
