Very new to Python and have very simple question. I would like to trim the last 3 characters from string. What is the efficient way of doing this?
Example I am going
becomes I am go
You can use new_str = old_str[:-3]
, that means all from the beginning to three characters before the end.