Nov-03-2017, 06:05 PM
Hi there everybody. I'm a total beginner to Python, I only just started looking at it yesterday, so at the moment I'm basically just attempting to do some simple things like dice rolls, but I'm mostly wondering how to create questions, specifically multiple choice questions.
So my first attempt reads like this, I don't want to run before I can walk!
Thanks very much for reading guys, like I said I am very new to this, but any words of wisdom are most welcome.
So my first attempt reads like this, I don't want to run before I can walk!
#Choices import time dir1="Forward" dir1=input("Which way do you want to move?") if dir1=="": print("You have to move!") (time.sleep(1)) print("-----") dir1=input("Which way do you want to move?") while dir1=="Forward": print("CHARGE")So I was thinking that the question "Which way do you want to move?" would keep on repeating as long as no answer was given, but it only repeats itself once, and then the program just ends if done again. My main question is how would I get the question to keep on looping? Also, when I do give the answer "Forward", "CHARGE" just becomes spam (at tremendous speed, too!), but I think I know why that is.
Thanks very much for reading guys, like I said I am very new to this, but any words of wisdom are most welcome.