View Single Post
Posts: 291 | Thanked: 398 times | Joined on Jan 2011 @ USA
#1
Hi,

I am noob in python, I need help with the syntax to trimp the string with python.

str = '187790012345'
strlen = 4
newstr = ?

I like the newstr to return only first strlen of str.... like '1877'

How do i do that in an effective way? Thanks.