Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
syntax trouble shooting
#1
Hi! I am new to python (and coding in general) and for one of my first projects I am making a hangman program. but i can't seem to get my syntax to work. I don't know if this matters but I am using repl.it python engine. Any form of help would be greatly appreciated! Here is my code
life = len(HANGMAN) - 1
words = ["hangman", "backpack", "bodywash", "clothing", "computer", "python", "program", "glasses", "sweatshirt", "sweatpants", "mattress", "friends", "clocks", "biology", "algebra", "suitcase", "knives", "ninjas", "shampoo", "chemistry", "sololearn", "bottle", "physics","flowers’,‘touch’,"machine","delirious","rambunctious","fixed","scab","girls","humdrum","lizards","spoon","rush","testy","homeless","clammy","pest","purring","leave","gun","lose","fall","bumpy","aberrant","squealing","story","cut","classy","colorful","slip","crooked","dazzling","make","helpful","envious","afterthought","indulge","wacky","compete","mixed","monkey","rainstorm","hysterical","effect","rude","slip","aloof","Earthquake", "curious"]
word = words[random.randint(0, len(words) - 1)]
guess = list(len(word) * '*')
Reply
#2
you have mixed quotes at flowers and touch
and because this is not the full code, we cannot run it for ourselves
always post the full code and the full traceback you get
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
(Sep-11-2020, 08:08 PM)buran Wrote: you have mixed quotes at flowers and touch
and because this is not the full code, we cannot run it for ourselves
always post the full code and the full traceback you get
Thank you buran! I'll be sure to post the full program next time.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  New Pythonista - Syntax Trouble sparkelyfox 2 2,571 Sep-29-2018, 11:02 AM
Last Post: sparkelyfox

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020