find a substring in a string python
<p>This might be a beginner question but I can't seem to find the answer anywhere</p>

<p>How do I search and return a substring from another string in which the charachers are in a different order ?</p>

<p>When I check with the code below it seems to give the right answer but I'm trying to print it rather getting True or False and also, when I submit it, it says "Incorrect. Your submission did not return the correct result for the input ('UdaciousUdacitee', 'Udacity'). Your submission passed 3 out of 4 test cases:" .... I'm confused..and I've been wrapping my brain around for 3 hours or so.</p>

<p>Thank you</p>

<pre><code>Test case 1: False 
Test case 2: True 
Test case 3: True 
Test case 4: True
</code></pre>

<p>More precisely:</p>

<pre><code>def fix_machine(debris, product):
  if debris.find(product):
   return product
  else:
   print("Give me something that's not useless next time.")


print "Test case 1: ", fix_machine('UdaciousUdacitee', 'Udacity') == "Give me something that's not useless next time."
print "Test case 2: ", fix_machine('buy me dat Unicorn', 'Udacity') == 'Udacity'
print "Test case 3: ", fix_machine('AEIOU and sometimes y... c', 'Udacity') == 'Udacity'
print "Test case 4: ", fix_machine('wsx0-=mttrhix', 't-shirt') == 't-shirt'
</code></pre>

<p>You're <code>print()</code>ing the <code>else</code> case. I think you meant to return that string. (at least according to your assertion code)</p>

python string substring