RosettaCodeData/Task/Substring-Top-and-tail/Python/substring-top-and-tail-1.py
2023-07-01 13:44:08 -04: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