Tell us what’s happening:
hey!
please help me identify why my code is showing error in step 2 itself…at first i thought its due to the fact that the prg requires 4 arguments and i have declared only one yet…but its not running even after writing the whole prg…and displaying the same error again n again even tho ntg is popping up in terminal…
Your code so far
full_dot = '●'
empty_dot = '○'
def create_character(name,arg1,arg2,arg3):
if not isinstance(name,str):
return "The character name should be a string."
if name=="":
return "The character should have a name."
if len(name)>10:
return "The character name is too long."
if " " in name:
return "The character name should not contain spaces."
if type(arg1)!= int or type (arg2)!= int or type (arg3)!= int:
return "All stats should be integers."
if arg1<1 or arg2<1 or arg3<1:
return "All stats should be no less than 1."
if arg1>4 or arg2>4 or arg3>4:
return "All stats should be no more than 4."
if (arg1+arg2+arg3)!= 7:
return "The character should start with 7 points."
str_dots = (full_dot * arg1) + (empty_dot * (10 - arg1))
int_dots = (full_dot * arg2) + (empty_dot * (10 - arg2))
cha_dots = (full_dot * arg3) + (empty_dot * (10 - arg3))
return f"{name}\nSTR {str_dots}\nINT {int_dots}\nCHA {cha_dots}"
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36
Challenge Information:
Build an RPG Character - Build an RPG Character