[ create a new paste ] login | about

Link: http://codepad.org/S3zjnKoD    [ raw code | output | fork | 1 comment ]

Python, pasted on Nov 2:
1
2
3
str = "abcdefgh"
newstr = str[-4:]
print newstr


Output:
1
efgh


Create a new paste based on this one


Comments:
posted by leonneo on Dec 25
Please do not use the variable name 'str'.
This is because you will have difficulties when you use the str() method.
reply