所以,我工作的一個腳本在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