擅长:python、mysql、java
<p>不是像anubhava那样的一行代码,而是使用基本的python知识:</p>
<pre><code>pattern="world!"
text="hello world! this is python"
def find_variabel(pattern,text):
new_text=text.split(' ')
for x in range(len(new_text)):
if new_text[x]==pattern:
return new_text[x+1]
print (find_variabel(pattern,text))
</code></pre>