I've successfully created a random number generator, and have used the random module before. But I am trying to add a touch of random to my weather simulator project. My issue is that when I add a variable assigned as a random number between 1 and 99, it just wont let me do it.
Here's the code. Can someone help me figure out the right way to do this?
import random
from random import*
t = 100
wmph = 51
h = 25
randwmph = random.randint(1, 99)
print ("\nDynamic Weather Simulator | V.004\n")
while True:
if t >= 0 and t <= 150:
print("\nHumidity:",h)
print("\nTemperature:",t)
print("\nWindSpeed:",wmph)
print("\n________________\n")
if t >= 5 and t <= 100:
h = h + 0.6
if h >= 50 and t >= 33:
print("\nRAINFALL\n")
if h >= 50 and t <= 32:
print("\nSNOWFALL\n")
if h >= 55:
h = h - 20
if wmph >= 30:
t = t - 2
if wmph <= 29:
t = t + 1
if wmph >= 60:
wmph = wmph - randwmph # UNABLE TO USE THIS VARIABLE AS A NUMBER, EVEN THOUGH IT IS ASSIGNED AS A RANDOM NUMBER BETWEEN 1 and 99
else:
wmph = wmph + 4