源代码
txt = "apple, banana, cherry" # setting the maxsplit parameter to 1, will return a list with 2 elements! x = txt.rsplit(", ", 1) print(x)
运行结果