Nov-23-2019, 04:48 AM
Thank you I think it worked. I have other bugs that popped up so I can't check it out right now
I have another question for myPlayer_job, I want to know if this is a valid statement (if not, how would I write it?)
The code below gives the following error:
'a1': {
TypeError: unhashable type: 'dict'
I don't understand what part in the code is an immutable object
I have another question for myPlayer_job, I want to know if this is a valid statement (if not, how would I write it?)
##### Class Stats ##### if myPlayer.job == 'warrior' == 'mighty warrior': player_hp = 100 #What I want to do here is, when the player wants to choose his "job" in "Job Handling" player_mp = 20 #let's say he wants to be a "warrior". If the player were to input "mighty warrior" it would elif myPlayer.job == 'wizard' == 'mighty wizzard': #still give him the same class. player_hp = 50 #First of all, the "if myPlayer.job == 'warrior' == ' mighty warrior':" probably wont work. player_mp = 120 #If I were to type "print(myPlayer.job)" this would probably give an error. ### Job Handling question3 = "Well then, tell me...\n Are you a mighty Warrior or a wize Wizard?\n" player_job = input('> ') valid.jobs = ['warrior', 'wizard'] if player_job.lower() in valid.jobs: myPlayer.job = player_job else: while player_job.lower not in valid.jobs: print('Say again, I did not understand.') print('What are you? a Warrior or a Wizard?') player_job = input('> ') if player_job.lower() in valid.jobs: myPlayer.job = player_jobAs I'm writing this, I got another bug.
The code below gives the following error:
'a1': {
TypeError: unhashable type: 'dict'
I don't understand what part in the code is an immutable object
ZONENAME = 'zonename' DESCRIPTION = 'description' EXAMINATION = 'examination' SOLVED: False UP = 'up' DOWN = 'down' LEFT = 'left' RIGHT = 'right' zonemap = { 'a1': { ZONENAME: 'Desert', DESCRIPTION: 'description', EXAMINATION: 'examination', SOLVED: False, UP: '', DOWN: 'b1', LEFT: '', RIGHT:'a2', }, 'a1': { ZONENAME: 'Desert', DESCRIPTION: 'description', EXAMINATION: 'examination', SOLVED: False, UP: '', DOWN: 'b1', LEFT: '', RIGHT:'a2' } }