here2share

# str_insert.py ^ 2018.09

Aug 19th, 2015
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. # str_insert.py -- since string objects do not support item assigning...
  2.  
  3. def insv(i,ins,v):
  4.     s=v[:i]+str(ins)+v[i:]
  5.     return s
  6.  
  7. py = 'Thank You, Python World!'
  8.  
  9. py = insv(9,' Very Much', py)
  10. print py
Add Comment
Please, Sign In to add comment