【发布时间】:2016-07-23 11:33:14
【问题描述】:
我想在特定条件下测试输入的字符串。在这种情况下,我希望变量中的字符串至少包含一个数字字符...
while any(inputted.isdigit()) == False:
print ("Inputted must contain at least one numeric character") # can't figure this one out
inputted = input("Please enter a combination: ")
理想的输入是像“Boat88Sea”这样的字符串
任何帮助将不胜感激!
【问题讨论】:
-
您能否举例说明您提供的输入类型?
inputted中的典型例子是什么 -
理想的输入是像“Boat88Sea”这样的字符串
标签: python string python-3.x validation input