Tell us what’s happening:
Hello,
I am a newbie to Python and programming in general. I’ve completed the first part of the introductory course, however I cannot wrap my head around the tasks given to the RPG character creation and I refuse to google the answer because even if I see it, I want to be able to understand it. Can anyone explain to me how I should proceed on step 11 and 12 so I can understand it and solve it myself? i did not find the answer in the previous lessons or maybe I looked the wrong way…
Thanks.
Your code so far
def create_character (name, STR, INT, CHA):
# NAME
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 not isinstance(STR, int):
return 'All stats should be integers'
if not isinstance(INT, int):
return 'All stats should be integers'
if not isinstance(CHA, int):
return 'All stats should be integers'
if STR < 1 or INT < 1 or CHA < 1:
return 'All stats should be no less than 1'
if STR > 4 or INT > 4 or CHA > 4:
return 'All stats should be no more than 4'
if STR + INT + CHA != 7:
return 'The character should start with 7 points'
name ='ren'
STR = '●●●●○○○○○○'
INT = '●●○○○○○○○'
CHA = '●○○○○○○○○○'
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Challenge Information:
Build an RPG Character - Build an RPG Character