any python programmers to help me with my code ?

jammy

Junior Member
Joined
Dec 5, 2008
Messages
127
Reaction score
99
at the moment , i am learning python from micheal dawson's e-book , and i need some help on the word jumble game

i dont see an error , but during execution , i am not able to make the program , display anything :(

can any one check it out for me ?

Code:
import random

WORDS = [ "apple" , "ball" ,"cat"]

word = random.choice(WORDS)

jumble = ""

correct = word

while word:
      position = random.randrange(len(word))
      jumble += position
      word = word[:position] + word[(position + 1):]
      

print """ welcome to the jumble game"""
print " the jumbled word is" , jumble

guess = raw_input("\ntake a guess :")
guess = guess.lower()

while (guess != correct) and (guess != ""):
      print " thats not the right word "
      guess = raw_input("take a guess :")
      guess = guess.lower()

if guess == correct:
      print " thats right"

raw_input(" press a key to exit ")
 
Dosent seem like , i am going to get help here .

Mods please delete this thread.
 
Dude, you waited like an hour for a response and said your not going to get any help.. ever heard of patience? :p
 
If its not displaying anything at all... then it sounds like your first while loop isn't ending. I'd start your debugging efforts there. ;) As a place to start, make sure your variable "word" will eventually evaluate to false to kick out of the loop.
 
Back
Top