
November 13th, 2012, 09:01 AM
|
 |
Contributing User
|
|
|
|
print(('No','Yes')[goal in text_to_be_searched])
You can choose how you populate the goal and the text_to_be_searched strings. source is a file name.
Code:
>>> with open(source,'r') as pf:
... text_to_be_searched = pf.read()
...
>>> import sys
>>> goal = sys.stdin.read()[:-1]
mighty
mouse
^D
>>> print(('No','Yes')[goal in text_to_be_searched])
No
>>>
__________________
[code] Code tags[/code] are essential for python code!
|