You are viewing a single comment's thread. Return to all comments →
If k > 0 (as is true here), then s[:len(s)-k] can be shortened to s[:-k].
k > 0
s[:len(s)-k]
s[:-k]
Seems like cookies are disabled on this browser, please enable them to open this website
Simple Text Editor
You are viewing a single comment's thread. Return to all comments →
If
k > 0
(as is true here), thens[:len(s)-k]
can be shortened tos[:-k]
.