Checking a word starts with specific alphabets python
<p>I have a string test_file1. I want to check taking a string from user if the string he/she enters starts with 'test'. How to do this in python? 
let args be =['test_file']</p>

<pre><code>for suite in args:
            if suite.startswith('test'):
                suite="hello.tests."+suite
            print(suite) // prints hello.tests.test_file
print(args) //prints ['test.file]' and not ['hello.tests.test_file']
</code></pre>

<p>you can use the regex.</p>

<pre><code>pat = re.compile(r'^test.*')
</code></pre>

<p>then you can use this pattern for checking each line.</p>

python