If the word you enter is 'xp11' then it will do that.
BTW you don't have to subtract one from wordsize, randrange() work like range().
Give it a test:
import random
#word = raw_input("Enter a word: ")
word = "consumer"
wordsize = len(word)
for k in range(10):
randomnumber = random.randrange(0, wordsize)
print word[randomnumber]
sneekula
Nearly a Posting Maven
2,427 posts since Oct 2006
Reputation Points: 961
Solved Threads: 212
Does your lower case letter L look like a 1?
It does on my screen.
Murtan
Practically a Master Poster
671 posts since May 2008
Reputation Points: 344
Solved Threads: 116
Okay, this is what I tried ...
import random
word = raw_input("Enter a word: ")
wordsize = len(word)
randomnumber = random.randrange(0, wordsize)
c = word[randomnumber]
print c, c.isdigit()
"""
one result after entering hello -->
Enter a word: hello
l False <--- this means that l is the letter l and not the number 1
"""
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417