Tell us what’s happening:
I have a weird situation. I tried “”" “”“, f” string, still steps 9 and 10 are not accepted though the result i get in terminal is exactly what is expected. I think i might be missing smth, but can you please help?
Your code so far
full_dot = '●'
empty_dot = '○'
def create_character(char_name, char_str, char_int, char_charisma):
if not isinstance(char_name, str):
return "The character name should be a string"
elif len(char_name) > 10:
return "The character name is too long"
elif char_name.count(" ") > 0:
return "The character name should not contain spaces"
if not isinstance(char_str, int) or not isinstance(char_int, int) or not isinstance(char_charisma, int):
return "All stats should be integers"
elif char_str < 1 or char_int < 1 or char_charisma < 1:
return "All stats should be no less than 1"
elif char_str > 4 or char_int > 4 or char_charisma > 4:
return "All stats should be no more than 4"
elif not char_str + char_int + char_charisma == 7:
return "The character should start with 7 points"
return print(char_name + "\nSTR " + full_dot * char_str + (empty_dot * (10-char_str)) + "\nINT " + (full_dot * char_int) + (empty_dot * (10 - char_int)) + "\nCHA " + (full_dot * char_charisma) + (empty_dot * (10 - char_charisma)))
create_character("ren", 4, 2, 1)
create_character("Pluhin", 2, 4, 1)
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Challenge Information:
Build an RPG character - Build an RPG Character