Tell us what’s happening:
Spoiler alert: There is code involved so if you don’t want to see and ruin your progress, don’t look below. I want to share my code with the community to check my answer rather than try to find the answer on google. I feel like peers could help me fill in any content holes. The error I’m seeing is that none of the checks past the function declaration are marked as correct even though I think I wrote several ideas of working code. Again, I apologize for posting this on the forum but I think I made a genuine effort to get started with what knowledge I gained from the basics so far. I am not looking for a solution to the question; but I am looking at critiques about glaring issues and ideas why I don’t have any of the benchmark tests completed. Also, any tips for how to get the circles to display. My pseudo code would be something like check the ‘x’ number of strength, and then write a circle in a string ‘x’ times but wasn’t sure which code could get me started. Thank you.
Your code so far
full_dot = '●'
empty_dot = '○'
def create_character(name, strength, intelligence, charisma):
if not isinstance(name(str)):
return "The character name should be a string."
if len(name) < 1:
return "The character should have a name."
if len(name) > 10:
return "The character name is too long."
nameindex = name.find(' ')
if nameindex == True:
return "The character name should not contain spaces."
if not isinstance(strength(int), intelligence(int), charisma(int)):
return "All stats should be integers."
if strength or intelligence or charisma < 1:
return "All stats should be no less than 1."
if strength or intelligence or charisma > 4:
return "All stats should be no more than 4."
if not strength + intelligence + charisma == 7:
return "The character should start with 7 points."
# return(name + "\nSTR")
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36
Challenge Information:
Build an RPG Character - Build an RPG Character