RosettaCodeData/Task/Substring-Top-and-tail/Python/substring-top-and-tail.py
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

3 lines
155 B
Python

print "knight"[1:] # strip first character
print "socks"[:-1] # strip last character
print "brooms"[1:-1] # strip both first and last characters