in Education by
I'm working on a mini text role playing game where you must survive dinner with the king. I'm trying to basically declare the variables in the if statement making the variable a certain value based on what the user input. I'm thinking I need to declare them outside the functions but I'm not sure I'm fairly new to python. def creation_role(): print("""What is your character's role?\n A: Lord (Base stats: Charisma 7, Wit 3, Valor 5) B: Peaseant (Base stats: Charisma 5, Wit 7, Valor 3) C: Knight (Base stats: Charisma 3, Wit 5, Valor 7)""") role = input("> ") role = role.lower() if "a" in role: role = "lord" charisma = 7 wit = 3 valor = 5 elif "b" in role: role = "peaseant" charisma = 5 wit = 7 valor = 3 elif "c" in role: role = "knight" charisma = 3 wit = 5 valor = 3 else: error() creation_role() def creation_home(): print("""Choose where you hail from:\n A. Hillford: Lush foliage as far as the eyes can see, the enchanted trees bear the fruit of wisdom.\n B. Aermagh: A land as beautiful as it is cold, it's people learn strength from the first day of life fighting frostbite as a babe.\n C. Venzor: The rich island nation some call it the pearl of Skystead, In recent decades it's seen outsiders giddy to make quick riches.""") home = input("> ") home = home.lower() if "a" in home: home = "Hillford" wit + 2 elif "b" in home: home = "Aermagh" valor + 2 elif "c" in home: home = "Venzor" charisma + 2 else: error() creation_home() def test(): creation_role() creation_home() print(home, "\n", charisma, "\n", wit, "\n", valor) test() JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

Related questions

0 votes
    I'm trying to make a function that will compare multiple variables to an integer and output a string of three ... like this possible? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    What's the proper way to declare custom exception classes in modern Python? My primary goal is to follow whatever ... is it necessary? Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    When you just want to do a try-except without handling the exception, how do you do it in Python? Is the ... rmtree(path) except: pass Select the correct answer from above options...
asked Jan 26, 2022 in Education by JackTerrance
0 votes
    I am facing problems in _files which isn't defined if I execute the script with exec, ececfile and in _module_ ... help me with this? Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    import re text = 'The quick. black n brown? fox jumps*over the lazy dog.' print(re.split('; | ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    import re text = 'The quick. black n brown? fox jumps*over the lazy dog.' print(re.split('; | ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    import re text = 'The quick. black n brown? fox jumps*over the lazy dog.' print(re.split('; | ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    import re text = 'The quick. black n brown? fox jumps*over the lazy dog.' print(re.split('; | ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    def multiple_dfs(xyz_file, sheet, *args): row=2 writer = pd.ExcelWriter(xyz_file, engine='openpyxl') df = pd. ... help me over this? Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
0 votes
    0 2 ['name:', 'Atlanta', 'GA:', 'Hartsfield-Jackson', 'Atlanta', 'International'] 35 ['name: ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    Hello I am quite new to pygame and I am trying to make an intro for a game where the user hovers ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    What makes using range() to make the process of generating a quadrillion values in a instant of time, I am amazed by ... o += 1 return Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    I'm trying to make the text move continuously by pressing a button but right now it only moves an ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 1, 2022 in Education by JackTerrance
0 votes
    Can we use just the tag name of structures to declare the variables for the same?...
asked Nov 9, 2020 in Technology by JackTerrance
0 votes
    I have a python variable how can I see that it's unsigned 32 bit or signed 16 bit, etc? Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
...