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