0

How do i ask for specific input from a user, using a for loop, to reject all wrong input and re - request for input?

4th Apr 2017, 1:36 AM
Ndeji Chiputa
Ndeji Chiputa - avatar
3 Respostas
+ 1
For example: zero=input("Please enter a zero.\n") while float(zero) != 0: zero=input("I said a zero.\n") print(zero) EDIT: If you are not using python you can use a do/while loop for better readability.
4th Apr 2017, 1:44 AM
Luca Garrera
0
Thank you very much :-)
4th Apr 2017, 1:48 AM
Ndeji Chiputa
Ndeji Chiputa - avatar
0
No problem :)
4th Apr 2017, 1:48 AM
Luca Garrera