Need help to code a program which:
- validate user input, accept values that a user has entered (ex, a, b, c, d, e)
- any other values other than these are to be treated invalid with a message and block it from processing.
- Prompt the user to enter the values again.
- The code should do this until a valid value has been entered.
- once a valid value has been entered it is to continue processing.
ic_m
0
Newbie Poster
Recommended Answers
Jump to PostI have posted one example of my coding here:
http://www.daniweb.com/forums/post1188875.html#post1188875You can make simpler version of this based on your input, this code is for more complicated case of number values from string.
if x in 'abc':
or
…if x not in 'abc':
All 3 Replies
TrustyTony
888
pyMod
Team Colleague
Featured Poster
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
baki100
-1
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.