Hi all,
So I had started learning python in my school a few months ago. I have been creating a program for a compitition thiat is being held in our school. Given below is a part of the code with which I need help.
print("How's the weather over there?")
w=input()
if(w=="hot"):
print("Oh now I wish I wasn't in this computer and could go out there and enjoy the heat!")
elif(w=="rainy"):
print("Wow! It's my favourite weather! I just can't resist the amazing atmosphere and the rainbow we see after the rain stops.")
elif(w=="cloudy"):
print("Doesn't it feel peaceful to just sit outside and watch the clouds? You should try it once.")
elif(w=="cold"):
print("You better have a warm blanket wrapped around your self and a cup of hot chocolate in your hands. This is the best solution for such a weather, according to my calculations.")
Now, what I want in this is that if I do not enter any of these things, it should show invalid input and then repeat the question and if I enter any of these words, it should show the result then move on to the next question. Can someone help me with this ASAP?
Pages 1