title: How to get last part of line with Python
body: <p>Lets say that I have prompt line:</p>
  
  <p>Your MAC address is              01:23:45:67:89:ab</p>
  
  <p>First part of line is always the same but last MAC address string changes all the time. </p>
  
  <p>I don't know how to get address from line. If the last part is always the same I would use something like:</p>
  
  <pre><code>    for line in output.split("\n"):
          if line.startswith('Your MAC address is'):
              if line.endswith("01:23:45:67:89:ab"):
                   # do something
                   # do something
  </code></pre>
  
  <p>But I am lost when changeable string appears.</p>