d1a = input ("Do you want to: A) Approach the house. B) Approach the stable. [A/B]? : ")
if d1a == "A":
print ("You approach the cottage.")
elif d1a == "B":
print ("You approach the stables.")
else
I have only just started learning python and it is my first language, so I am just playing about with it. Is it possible for the else statement to ask for the input again and it to be saved as the same variable when neither A or B is typed in?
EDIT:
import time
import random
import sys
print ("You wake up to find yourself in a clearing off a forest, sounded by tall")
print (" trees on all sides with a path ahead of you")
d1 = input ("Do you want to : A) Walk down the path. B)Move your way through the trees? [A/B]: ")
if d1 == "A":
print ("You begin to walk down the path.")
print (" As a Sidenote, during this adventure 'dice' will be thrown and the success of your chosen action")
print (" will be determined by the result.")
r1 = random.randint(0.0,10.0)
if 4 > r1 > 0.1:
print (" Your groggyness from waking means you reach the edge of the forest after nightfall.")
print (" You see that the path continues towards a small cottage, the lights are out and no smoke rises from the chimney.")
print (" Away from the cottage is a stable, where you can see a horse standing with its head outside the door")
d1a = input ("Do you want to: A) Approach the house. B) Approach the stable. [A/B]? : ")
if d1a == "A":
print ("You approach the cottage.")
elif d1a == "B":
print ("You approach the stables.")
else :