Build an RPG Character - Build an RPG Character

Tell us what’s happening:

My code doesn’t work, the console shows
Traceback (most recent call last):
File “main.py”, line 63, in
File “main.py”, line 21, in create_character
TypeError: ‘<’ not supported between instances of ‘tuple’ and ‘int’

Please send help, thank you in advance!

Your code so far

full_dot = '●'
empty_dot = '○'

def create_character(c_name, c_str, c_int, c_cha):

    if not isinstance(c_name, str):
        return 'The character name should be a string'

    if c_name == '':
        return 'The character should have a name'
    
    if len(c_name) > 10:
        return 'The character name is too long'

    if c_name.count(' ') > 1:
        return 'The character name should not contain spaces'

    if not ((c_str, c_int, c_cha),(int, float)):
        return 'All stats should be integers'

    if (c_str, c_int, c_cha) < 1:
        return 'All stats should be no less than 1'

    if (c_str, c_int, c_cha) > 4:
        return 'All stats should be more than 4'

    t_stats = c_str + c_int + c_cha

    if t_stats != 7:
        return 'The character should start with 7 points'

    if (c_str, c_int, c_cha) == 1:
        return '●○○○○○○○○○'

    if (c_str, c_int, c_cha) == 2:
        return '●●○○○○○○○○'

    if (c_str, c_int, c_cha) == 3:
        return '●●●○○○○○○○'    
    
    if (c_str, c_int, c_cha) == 4:
        return '●●●●○○○○○○'

    if (c_str, c_int, c_cha) == 5:
        return '●●●●●○○○○○'

    if (c_str, c_int, c_cha) == 6:
        return '●●●●●●○○○○'

    if (c_str, c_int, c_cha) == 7:
        return '●●●●●●●○○○'

    if (c_str, c_int, c_cha) == 8:
        return '●●●●●●●●○○'    
    
    if (c_str, c_int, c_cha) == 9:
        return '●●●●●●●●●○'

    if (c_str, c_int, c_cha) == 10:
        return '●●●●●●●●●●'


create_character('fan', 3, 3, 2)

    

Your browser information:

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

Challenge Information:

Build an RPG Character - Build an RPG Character

Hi @fahnick,

The syntax on that line is incorrect. In what theory lecture did you see code that allows you to check a tuple of values against an integer? Use what you have learned, please.

I suggest temporarily removing all the code you have after the first if statement, then calling your function with values you know should not pass that validation and see if it returns the expected message. Then add the next if statement and do the same type of check. Continue that type of debugging and make sure you are implementing the user stories as asked (I see one that is not).

Happy coding!

I DID IT!

Thank you @dhess

removed by moderator

Congratulations on solving the challenge! You should be proud of your achievement…we are! But we are removing your working solution, so it is not available to others who have not yet done the work to get there. Again, congrats!