所以,我工作的一个脚本在Python 3,我需要这样的条件如果字符串只包含变量和整数的Python
control_input=input(prompt_029)
if only string_029 and int in control_input:
#do something
else:
#do something else
基本上,我要求的代码,将有这样的条件这个:
if control_input == "[EXACT_string_here] [ANY_integer_here]"
代码在Python 3中看起来如何?
用[正则表达式](http://docs.python.org/3/library/re.html#re.match)。 – millimoose 2013-03-24 16:35:51