[Tutor] New to programing and the tutoring system

Samuel Kroger sakroger at gmail.com
Tue Jul 16 16:15:44 CEST 2013


Hello I am very very new to programing entirely, I have this book I am
following, and I made a word jumbling game, it chooses a word from random
from a turple I made, then scrambles the word and asks you to guess it, it
is very simple but for some reason it only works when it's in idle. Here is
the script.
import random
WORDS=("python","jumble","easy","difficult","answer","xylophone")
word=random.choice(WORDS)
correct=word
jumble=""
while word:
    position=random.randrange(len(word))
    jumble+=word[position]
    word=word[:position]+word[(position+1):]
print("""    Welcome to Word Jumble!

Unscramble the letters to make a word.
(Press the enter key at the prompt to quit.)
"""
)
print("The jumble is:",jumble)
# Working as intened at this point
guess=input("\nYour guess: ")
while guess != correct and guess !="":
    print("Sorry, that's not it.")
    guess=input("Your guess: ")
if guess==correct:
    print("That's it! You guessed it!\n")
print("Thanks for playing.")
input("\n\nPress the enter key to exit.")

Also I am using the most recently updated version of python33. Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130716/71b7df5e/attachment.html>


More information about the Tutor mailing list