Cuéntanos qué está pasando:
My code is working correctly; I just want to identify which error the page is detecting that I’m currently unable to see.
Tu código hasta el momento
full_dot = '●'
empty_dot = '○'
def create_character(name, force, intell, chari):
a = isinstance(force, int)
b = isinstance(intell, int)
c = isinstance(chari, int)
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 a == False or b == False or c == False:
return 'All stats should be integers'
if force < 1 or intell < 1 or chari < 1:
return 'All stats should be no less than 1'
if force > 4 or intell > 4 or chari > 4:
return 'All stats should be no less than 4'
if force + intell + chari != 7:
return 'The character should start with 7 point'
else:
global full_dot
global empty_dot
sequen = 'STR'
for i in range(0,force):
sequen += full_dot
for i in range(0,10-force):
sequen += empty_dot
sequen2 = 'INT'
for i in range(0,intell):
sequen2 += full_dot
for i in range(0,10-intell):
sequen2 += empty_dot
sequen3 = 'CHA'
for i in range(0,chari):
sequen3 += full_dot
for i in range(0,10-chari):
sequen3 += empty_dot
return f'{name} \n{sequen} \n{sequen2} \n{sequen3}'
result = create_character('Hola', 2, 4, 1)
print(result)
Información de tu navegador:
El agente de usuario es: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0
Información del Desafío:
Construir un Personaje de RPG - Construir un personaje de RPG