crop string in python code example Example: python crop string text = "abc" truncated_text = text[0:2] print(truncated_text) # Output ab