How to ensure the user entered a valid word?


#1

x=raw_input('enter the word')
if len(x)>0:
y=str(x)[1:]
z=str(x)[0]
print y+z+'ay'
else:
print'Type again'

==========
above is my code
i pass the test,but i can't ensure the user input the valid word
what should i do?


#2

For the purposes of the exercise any string made up of letters would be considered valid.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.