mardi 25 septembre 2018

Why do I keep getting "Shutting down..." as an output no matter what? [duplicate]

This question already has an answer here:

I'm trying to create a text based mini game. For the code of my loading screen, no matter what I input, I get "Shutting Down..." What am I doing wrong?

import random
import sys
def characterCreation():
    gender = raw_input("Please enter your gender: ")
    name = raw_input("Please enter your name: ")
    age = raw_input("Please enter your age: ")
def loadingScreen():
    option = raw_input("Welcome to Riften! Type either 'Play Game' or 'Quit' to procede!: ")
    option = str(option)
    if option == "Quit" or "quit" :
        sys.exit('Shutting down...')
    elif option == "Play Game" or "Play game" or "play Game" or "play game":
        characterCreation()
    else:
        while option != "Quit" or "quit" or "Play Game" or "Play game" or "play Game" or "play game":
            print("Please choose a valid option.: ")
            option = raw_input("Type either 'Play Game' or 'Quit' to procede!: ")
loadingScreen()

I wanna have it where if the user inputs "quit" in any capitalization, the program exits. If the user inputs "play game" the game continues to the character creation screen, and if the user inputs any thing else, to ask for the input of either "play game" or "quit" until given

Thank you

Aucun commentaire:

Enregistrer un commentaire