Python if conditions
python if condition Basic example print(“Is it raining? Yes/No “) # check whether its raining or not raining = input().lower() #convert the input into lower case and store it in a variable named ‘raining’ if raining==’yes’: #check if it is raining print(“Its raining”) print(“Do you have umbrella? Yes/No”) #ask whether have umbrella or not have_umbrella = input().lower() #convert the user input into lower case and store it in a variabel ‘have_umbrella’ if have_umbrella ==’yes’: #if you have umbrella print(“I have umbrella”) print(“You can go Out side”) # print go out side message else: #if not have umbrella, print ‘Wait untill rain stops’ message print(“Wait untill rain stops..”) elif raining == ‘no’: # if not raining print ‘No need of umbrella , Not raining ..’ message print(“No need of umbrella. Not raining. You can go anywhere..”)