阅读背景:

如何让用户输入有效字符?

来源:互联网 

I am writing a program called hangman.py. In my program the user cannot input "?' or whitespace in my input. For example, the user cannot enter: '?xx?xx?' or 'How do I do this'. But the user can input something like 'ldkdjgg' or 'stop-go'. If the user enter something like '?xxxxx?' or 'How do I do this' I have to keep asking the user "Please enter a word to be guessed that does not contain ? or white space:". My question is how do I print "Please enter a word to be guessed that does not contain ? or white space:" until the user stop entering '?' or whitespace in the input.I am writing a program called hangman.py. In my




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: