Ask coding questions

← Back to all posts
dylcho89 (0)

Why in my coding

for letter in chosen_word:

the part "letter" is keep showing in blue color not white color.

I believe this is the reason why it's keep showing up as error and it's not working as supposed to just like Angela's

What the hell is this error?

jesus christ

Can anyone help?

themining72 (49)

This is intended and is called syntax highlighting, the reason your friend one isn't blue is likely because it's lagging, reloading the page would turn it blue. As for the not working problem, here is the correct code:

import random 

word_list = ["aardvark", "baboon", "camel"]

chosen_word = random.choice(word_list)

for letter in chosen_word:
  guess = input("Guess a letter: ").lower()
  if letter == guess:

Line 14 for letter in chosen_word: was not necessary
Line 11 guess = input("Guess a letter: ").lower you forgot ()
Line 11 guess = input("Guess a letter: ").lower() <- Corrected

dylcho89 (0)

Sorry that didn't work either
It just gives one line of "wrong" or "right".

themining72 (49)

@dylcho89 Yes, that's correct. Is that.. not what you want?

dylcho89 (0)

Thanks for your help but I was more to get help on fixing that error issue.

I find it waste of time.. I realize now that Angelina just posts her videos here and doesn't look after any possible errors that are arising in the future for the future students..

I can already see her video versions are older than what I am using etc.

She doesn't even come back around to check if anyone is facing errors.

I should look for offline courses rather than wasting my time on online.. it's ridiculous not realizing you got it right but then you didn't know you were right because the website itself has errors and lagging?.. pfff

themining72 (49)

@dylcho89 Oh I've understood what you've wanted now, I've updated my answer.

themining72 (49)

@dylcho89 Oops nevermind, I didn't see that message before updating it. Alse the website isn't lagging, their computer was.