i have no idea what is wrong it wont pass any of the tests ive seen similarposts but their code is genreally no different than mine please help!
Your code so far
cfull_dot = '●'
empty_dot = '○'
def create_character(name, strength, intelligence, charisma):
stats = {
"name": name,
"strength": strength,
"intelligence:" intelligence,
"charisma": charisma
}
if not isinstance= name, str:
return "The character name should be a string."
if len(name)>10:
return "The character nam is too long."
if name=='':
return "the character should have a name"
if " " in name:
return "The character name should not contain spaces."
…
for stat in stats:
if not isinstance(stat, int):
return "All stats should be integers"
if stat<1:
return "All stats should be no less than 1."
if stat >4:
return "All stats should be no less than 4."
if sum(stats)!=7
return "The character should start with 7 points."
char= (
f"{name}\n"
f"STR {full_dot * strength}{empty_dot * (10- strength)}\n"
f"INT" {full_dot * intelligence}{empty_dot *(10-intelligence)}\n"
f"CHA {full-dot * charisma}{empty_dot*(10-charisma)}."
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36
First of all, I can see multiples SyntaxError (if you have any errors in your code, every test is gonna say : “Your code raised an error” or something like that)
Have you tried printing the output ? It really helps to have a print() at the bottom of your code.
Just for curiosity, where have you learnt how to use dictionaries ? There is a whole section dedicated for that.
Hi thanks Jarvis i will try that! i have some basic python knowledge gained from books so hence know about dictionarys. Pkdvalis my console just shows wwwww and nothing else thanks again