Jun-08-2017, 12:48 AM
Whenever you have issues with code, please provide the minimum, runnable code to reproduce the problem as well as the input you're giving to reproduce the problem. For example, here's the code I'm using that appears to work
VC1 = {1, 2, 3, 4, 5} def test(): D9 = int(input()) while D9 not in VC1: print ("That is not a correct value. Try again.") D9 = int(input()) else: print ("You selected", D9)Interactive session showing use:
Output:>>> test()
10
That is not a correct value. Try again.
-1
That is not a correct value. Try again.
0
That is not a correct value. Try again.
7
That is not a correct value. Try again.
6
That is not a correct value. Try again.
1
You selected 1
>>> test()
2
You selected 2
>>> test()
3
You selected 3
>>> test()
4
You selected 4
>>> test()
5
You selected 5