Simple question here. Im trying to figureout how to write a program in such a way that when a word is entered, the output is each individual letter of that word in a random order. so if pizza is entered, the output would be
P
Z
A
I
Z
I have a general idea of how to output the letters, but not without them repeating. Id like to figure this out myself, but would appreciate being pointed in the right direction. heres the code thus far:
[CODE=python]
import random
word = "index"
print "The word is: ", word, "\n"
high = len(word)
low = -len(word)
x=len(word)
for i in range(x):
position = random.randrang e(low, high)
print "word[", position, "]\t", word[position]
raw_input("\n\n Press the enter key to exit.")
[/CODE]
thanks
P
Z
A
I
Z
I have a general idea of how to output the letters, but not without them repeating. Id like to figure this out myself, but would appreciate being pointed in the right direction. heres the code thus far:
[CODE=python]
import random
word = "index"
print "The word is: ", word, "\n"
high = len(word)
low = -len(word)
x=len(word)
for i in range(x):
position = random.randrang e(low, high)
print "word[", position, "]\t", word[position]
raw_input("\n\n Press the enter key to exit.")
[/CODE]
thanks
Comment