Ask coding questions

← Back to all posts
Keep getting the same score from this code can someone help?
Uzalii (433)

This code is really annoying me because i can't seem to get a different score other than 4/10 plz can someone tell me what i am doing wrong.

Answered by SilentShadowBla (552) [earned 5 cycles]
View Answer
Comments
hotnewtop
SilentShadowBla (552)

I got it to work...
this will explain look at comments
if this is the right answer please mark it so :)
https://repl.it/@SilentShadowBla/SmartneZ

Uzalii (433)

@SilentShadowBla Thx so much bro it works well now i selected your answer.

AtriDey (171)

If you spam enter, you get 3/10

Coder100 (15490)

You have a small error.

score == score - 1
# ↕
score = score - 1

And this can be more efficiently put as

score -= 1
# &
score += 1
Uzalii (433)

@Coder100 now i just keep getting 3/10

Coder100 (15490)

For each if statement, why don't you see what's going on

if age2 ==  "yes" or "Yes":
  score = score - 1
  print(score)

@Uzalii

StevenWang2 (10)

Instead of using score == score -1, use score = score -1, or score -= 1

Thecrowbar1234 (140)

in the first if it says score == score - 1 not score = score -1

Thecrowbar1234 (140)

what is the score you keep getting