Python : Asking the user for input until they give a valid response

preview_player
Показать описание
Video Tutorial shows the step by step guide to create a python program for taking input from user, until he gives a valid response.

Рекомендации по теме
Комментарии
Автор

Thanks bro! I got clue to finish my assignment with your codes.

meettewar
Автор

thank you so much please keep making more python examples. i did your exact same code but i didnt have the continue the last one after the flag == True and print, i just left it like that without a continue, and the code worked fine

abelwolf
Автор

Thanks a lot. The statement `flag = False` should be after `while True`. Try run your code and type a capital letter in the username then in the same execution type a valid username with lowercase, you will get the message `sorry, no capital letters` each time as flag is marked as True. so I think it will be better to put the flag=False after while True.

KhalilYasser
welcome to shbcf.ru