diff --git a/alternative.py b/alternative.py index 8289c6b..9cc6542 100644 --- a/alternative.py +++ b/alternative.py @@ -1,11 +1,11 @@ -''' +""" sphinx story is good https://github.coventry.ac.uk/lycette2/CuriosityKilledTheSphinx -''' +""" history = [] # empty storage area for choices @@ -73,6 +73,7 @@ def getAnswer2(question, text): # function to handle 2 responses from the user history.append(choice.upper()) # adds the choice the user picked + def getAnswer3(question, text): # function to handle 3 responses from the user loop = True choice = "" @@ -130,6 +131,7 @@ def getAnswer4(question, text): # function to handle 4 responses from the user history.append(choice.upper()) # adds the choice the user picked + # Main block start() diff --git a/textgenerator.py b/textgenerator.py new file mode 100644 index 0000000..2fa3843 --- /dev/null +++ b/textgenerator.py @@ -0,0 +1,20 @@ +optionsList = ["A", "B", "C", "D", "E", "F"] + +options = input("How many options? (max = 6)->") +line = "text = {" + +for i in range(1, int(options)+1): + if int(options) == 1: + textInput = input("Paste the text for option " + optionsList[i-1] + ":") + line = line + "\"" + optionsList[i-1] + "\": " + "\"" + textInput + "\"}" + elif i == 1: + textInput = input("Paste the text for option " + optionsList[i - 1] + ":") + line = line + "\"" + optionsList[i - 1] + "\": " + "\"" + textInput + "\",\n" + elif i < int(options): + textInput = input("Paste the text for option " + optionsList[i-1] + ":") + line = line + " \"" + optionsList[i-1] + "\": " + "\"" + textInput + "\",\n" + else: + textInput = input("Paste the text for option " + optionsList[i - 1] + ":") + line = line + " \"" + optionsList[i - 1] + "\": " + "\"" + textInput + "\"}" + +print(line)