319,238 views
16 votes
16 votes
Techsmart

What are the chances that it is raining in Hawaii at any given time? Make a simple program that simulates the answer.

Requirementsexpand_less
Make a weighted random choice
1 in 5 chance of printing "Rain"
4 in 5 chance of printing "Sunshine"
"""
Built-in Libraries
Technique Practice: Weighted Choice
Hawaii Weather
"""

#### ---- SETUP ---- ####

import random
print("HAWAII WEATHER SIMULATOR")
print()
print("Today's weather will be:")

#### ---- RESULTS ---- ####

User Norisknofun
by
2.6k points

1 Answer

20 votes
20 votes

import random

print("HAWAII WEATHER SIMULATOR")

print()

print("Today's weather will be:")


Thats should work.

User Muhammad Ahmed
by
3.1k points