Help me in error line no 18 | Sololearn: Learn to code for FREE!


Help me in error line no 18

7/25/2021 3:34:19 AM

Vibhor Kumar

3 Answers

New Answer


import random Name=Input("what is your name") print("good luck."+Name) word=['hunter','gamer','father','colourful','computer'] #here you override word variable from list to string!! #instead better to use words for list and word for string word=random.choice(word) print ("guess the word") gues="" turn=10 while turn>0: faild=0 else: print("") faild +=1 if faild ==0: print("you win") guess=input("guess a word") gues+=guess here you forgot to end the line with colon <:> if guess not in word turn-=1: print("worng") print("you have"+turn) if turn==0: print("you lose")


if guess not in word: turn-=1 (line 18 should end in colon ":" and not line 19) (if and else ends in colon :)


BLACK GAMING And also there is a problem on line number 2, 21 and 23 I had already given you solution but you still didn't change anything in your code and came with same problem. Why? You should give your effort man.