Print using for loop - Python
<p>I am fairly very new to Python or any programming language for that matter. I am finding it challenging to print arbitrary text along with with iterated values from a list, using for loop. What I need is to print the whole first item of the list with arbitrary text "shutdown" and repeat the same for new text "no shutdown". Also, I want to be able to insert any text statements between the two separate outputs: Please advise. Here is more information..</p>

<p><strong>CURRENT OUTPUT: Which is not desired</strong></p>

<pre><code>interface Vlan100
 shut
 no shut
interface Vlan108
 shut
 no shut
</code></pre>

<p><strong>EXPECTED OUTPUTS:</strong></p>

<p><em># First time printing:</em></p>

<pre><code>********* THIS IS INTERFACE OUTPUT WITH "SHUTDOWN" **********
interface Vlan100
 shutdown
interface Vlan108
 shutdown
</code></pre>

<p><em><strong></em>**<em></strong> THIS IS INTERFACE OUTPUT WITH "NO SHUTDOWN" <strong></em>**<em>*</em></strong></p>

<pre><code>*# Second time printing:*
interface Vlan100
 no shutdown
interface Vlan108
 no shutdown
</code></pre>

<p><strong>CODE EXTRACT, Snipped for brevity reasons.</strong></p>

<pre><code>for i in servicetypes:
&lt;snip&gt;
&lt;snip&gt;
elif "ipv4 address" in i or "ipv4 address 8" in i or " ipv4 address 213" in i:
    i = re.sub(r'encapsulation dot1Q \d+\n\s','',i)
    i = re.sub(r'TenGigE[0-9]/[0-9]/[0-9]/[0-9].','Vlan',i)
    internet = i.split("\n")
    print internet[1]
    print " shut"
    print " no shut"
</code></pre>
