Splitting list items and adding value to them in python
<p>I want to split list items then add values to them. To do this I am required to take the first sentence; split it into a list; use the <code>isdigit()</code> to determine if the list element is a digit then add 1 to the element; join the new list elements together using <code>join()</code>. It needs to be done using the for loop with enumerate. </p>

<p>This is my code :</p>

<pre><code>a="You would like to visit "+li[0]+" as city 1 and " +li[1]+ " as city 2 and "+li[2]+" as city 3 on your trip"      
print a
printer = a.split(" ")
print printer
if printer.isdigit():
</code></pre>

<pre><code>' '.join([ str( int(i)+1 ) if i.isdigit() else i for i in a.split() ] )
</code></pre>

python