Hi all,
I am new to programming, and i'm working from a booik which has set me a challenge with a random jumble word program to pair the jumble word with a hint. I have been going round in circles trying to work it out, please help point me in the right direction.
Here is my code:
import random
name = ("stephen","bob", "robert","bill")
word = random.choice(name)
correct = word
jumble = ""
while word:
position = random.randrange(len(word))
jumble += word[position]
word = word[:position] + word[(position +1):]
print("\nThe jumble word is: ",jumble)
guess = input("\nTake a guess: ")
while guess != correct and guess !="":
print("\nYour guess is wrong: ")
guess = input("\nTake another guess: ")
if guess == correct:
print("\nWell done you have guessed correctly.")
print("\nGoodbye.")
input("\nPress the enter key to exit.")