Cuéntanos qué está pasando:
Mi práctica de “construir un personaje RPG” solo aprueba los 10 primeras pruebas, pero las 2 últimas no me permite. Me marca error en como debe mostrar el mensaje y que debe mostrar, pero no avanza. El problema solo es en la plataforma porque en ambientes de prueba local si lo ejecuta
Tu código hasta el momento
full_dot = '●'
empty_dot = '○'
def create_character(nombre, fza, intel, car):
#verificamos la cadena
if not isinstance(nombre, str):
return "The character name should be a string"
if nombre == "":
return "The character should have a name"
if len(nombre) > 10:
return "The character name is too long"
if " " in nombre:
return "The character name should not contain spaces"
#Validar estadistica
if not isinstance(fza, int) or not isinstance(intel, int) or not isinstance(car, int):
return "All stats should be integers"
if fza < 1 or intel < 1 or car < 1:
return "All stats should be no less than 1"
if fza > 4 or intel > 4 or car > 4:
return "All stats should be no more than 4"
if fza+intel+car !=7:
return "The character should start with 7 points"
else:
return nombre+"\nSTR "+full_dot+full_dot+full_dot+empty_dot+empty_dot+empty_dot+empty_dot+empty_dot+empty_dot+empty_dot+"\nINT "+full_dot+full_dot+empty_dot+empty_dot+empty_dot+empty_dot+empty_dot+empty_dot+empty_dot+empty_dot+"\nCHA "+full_dot+empty_dot+empty_dot+empty_dot+empty_dot+empty_dot+empty_dot+empty_dot+empty_dot+empty_dot
#result =""
#result += nombre +"\n"
#result += "STR "+full_dot*fza+empty_dot*(10 - fza)+"\nINT"
#result += "INT "+full_dot*intel+empty_dot*(10 - intel)+"\n"
#result += "CHA "+full_dot*car+empty_dot*(10 - car)+"\n"
#return result
#llamamos a la función
resul = create_character('ren',4,2,1)
print (resul)
Información de tu navegador:
El agente de usuario es: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Información del Desafío:
Construir un Personaje de RPG - Construir un Personaje de RPG