How to split the last part of a string in Python

1 Answer

0 votes
s = "c c# c++ java python"

last_part = s.rsplit(' ', 1)[-1]

print(last_part) 



'''
run:

python

'''

 



answered Aug 18, 2023 by avibootz

Related questions

1 answer 217 views
217 views asked Aug 20, 2023 by avibootz
1 answer 221 views
1 answer 205 views
1 answer 190 views
190 views asked Aug 18, 2023 by avibootz
1 answer 204 views
...