Build an RPG character - Build an RPG Character

Tell us what’s happening:

I’ve looked all over for a solution, not sure what I really need to do to pass step 9?

Your code so far

full_dot = '●'
empty_dot = '○'

def create_character(name, strength, intelligence, charisma):
    if not isinstance(name, str):
        return 'The character name should be a string'
    if len(name) > 10:
        return 'The character name is too long'
    if " " in name:
        return 'The character name should not contain spaces'

    stats = (strength, intelligence, charisma)
    for s in stats:
        if not isinstance(s, int):
            return 'All stats should be integers'
        if s < 1:
            return 'All stats should be no less than 1'
        if s > 4:
            return 'All stats should be no more than 4'
        
    if sum(stats) != 7:
            return 'The character should start with 7 points'
    
    

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36

Challenge Information:

Build an RPG character - Build an RPG Character

Did you try comparing the requirement of Test 9 with your output?

Did you try to implement User Story 5? It looks like you’re not finished?

character_name = name

STR = (4 * full_dot) + (6 * empty_dot)
INT = (2 * full_dot) + (8 * empty_dot)
CHA = (1 * full_dot) + (9 * empty_dot)

print(create_character("ren", 4, 2, 1))

Tried this with no luck…

If you change the character’s stats are those going to update?

Are you getting any error messages?

It looks like you have hard-coded conditionals or variables that check for specific expected values. That is not solving this problem in the general case. Imagine if you were given different input values. Would your code be able to solve those problems?

To find out more about what hard-coding is or about why it is not suitable for solving coding questions, please read this post: Hard-coding For Beginners

Let us know if you have a question about how to make your code more flexible.

I’m honestly stumped on this one

do not use numbers there, you need to make it work for any value of the three stats

Can you share your full updated code?