Construir un Personaje de RPG - Construir un Personaje de RPG

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

Welcome to the forum @juanjovg1984

Why does callingprint(create_character('ren',4,1,2)) return the same string as print(create_character('ren',4,2,1))?

Happy coding

este seria el código completo y corregido:
code removed by moderator

hi @juniorhin15

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge. How to Help Someone with Their Code Using the Socratic Method

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.