I'm not quite sure I follow you, sorry. I've only used 'while' once, and it was to decide whether or not to ask the user for input a second time. The loop you gave seems to be concerned whether the input is a word. I don't understand your loop entirely or how I could integrate it into my script, sorry.
Maybe I should post parts of my code so far(end of post)? My question is badly worded, I'll admit. English isn't my first language, and my mastery of Python or the basic tenets of programming are inexistent.
Basically, my program will make a dictionary containing names of properties and their values(determined by the main body of the script below). Now, once this dictionary is complete, I want the program to ask the user to give another input. This input is meant to be a key from the dictionary. It will then print the corresponding value out of the dictionary, and then ask the same question again. It's just meant to keep asking the same question,regardless of what it prints or what input is given. If the input is not a key in the dictionary, it is also meant to repeat the question.
Here is my very bad little script in progress. It's undergoing the transformation from printing to dictionary entries, so instead of printing strings that tell you whether it is prime, even etc, it will add them as values to some dictionary key. I hope the inclusion of my incomplete source code helps you to understand my inane ramblings.
Sorry for long reply.
EDIT: I have gotten it to ask for keys (UI=str(raw_input('What are you looking for?'))
;print Properties[UI]). It works. Now for the repeating of the question...
import math
n=int(raw_input('Enter a positive integer:'))
m=[1]
p=range(2,n)
Properties={'Proper divisors':m ,'Perfect':'Start', 'Prime':'A string', 'Square root':'Nothing yet', 'Even or odd':'Will be added by the program itself by replacing it with another string later', 'Triangular':'same', 'Square':'ditto'}
for x in p:
if n%x==0:
m.append(x)
p.remove(x)
else:
pass
if len(m)>1:
Properties['Proper divisors']= str(m)
else:
pass
a=reduce(lambda y,x: x+y, m)
if a==n:
Properties['Perfect']= str(n)+' is a perfect number'
else:
Properties['Perfect']= str(n)+' is an imperfect number'
if len(m)==1:
Properties['Prime'] 'Yes'
else:
Properties['Prime'] 'No'
squareroot=math.sqrt(n)
Properties['Square root'](str(n)+' has square root '+str(squareroot))
r=tuple(m)
if 2 in r:
Properties['Even or odd']='Even'
elif len(m)!=1:
Properties['Even or odd']='Odd'
elif len(m)==1:
pass
if n==2:
print('This number is even')
for g in range(2,n):
if reduce(lambda y,x: x+y, range(1,g))==n:
print(str(n)+' is a triangular number')
break
else:
pass
for g in range(2,n):
if g**2==n:
print (str(n)+' is a square number')
break
else:
pass