Tell us what’s happening:
i have no idea to return result, i need some hint. I try to make loop to print dot follow stat but i think it wrong way to done this lab
Your code so far
full_dot = '●'
empty_dot = '○'
full_dot = '●'
empty_dot = '○'
def create_character(name, Str, Int, Charm):
#check name
if not isinstance(name, str):
return 'The character name should be a string'
elif not name:
return 'The character should have a name'
elif len(name) > 10:
return 'The character name is too long'
elif ' ' in name:
return 'The character name should not contain spaces'
# check stats
if not all(isinstance(x, int) for x in (Str, Int, Charm)):
return 'All stats should be integers'
elif min(Str, Int, Charm) < 1:
return 'All stats should be no less than 1'
elif max(Str, Int, Charm) > 4:
return 'All stats should be no more than 4'
elif (Str + Int + Charm) != 7:
return 'The character should start with 7 points'
# x = 0
# while x < 10:
# if x < Str:
# print(full_dot, end="")
# else:
# print(empty_dot, end="")
# x+=1
return f'{name}???'
print(create_character('ren', 4, 2, 1))
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36
Challenge Information:
Build an RPG Character - Build an RPG Character