When I run the code in PyCharm, I get exit code 0, so I know the file is compiling properly. What I don't understand is why it's not displaying anything.
I have it set up to take input and output an appropriate response based on that input, but neither CMD or PyCharm are displaying anything when I run the file. Debugging didn't throw an error, so as far as I can tell, the code itself is properly written.
Did I miss something? Am I not invoking the function properly?
def wthGen(weather):
# after generating, defines the weather states
for weather in range(0, 5):
x = 0
if weather == 0:
print("It's a beautiful day.")
if weather != 0:
x += 1
if x == 1:
print("There's a light rain; bring a coat! ")
elif x == 2:
print("The air is thick with fog. Perception debuffs apply.")
elif x == 3:
print("The rain beats down without remorse. Perception debuffs apply +1")
elif x == 4:
print("The snow nips at your fingers. Dexterity debuffs apply.")
elif x == 5:
print("The wind rages against you with all its fury. Strength debuffs apply.")
# calls wthGen to determine weather state
def main(wthGen):
w = int(input("Enter a number from 0 to 5 to determine appropriate debuffs based on weather conditions: "))
print(wthGen[0,5](w))
main()