How to remove the last comma from the end of string in Python

1 Answer

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

s = s.rstrip(',')

print(s)



'''
run:

c,c++,java,python

'''

 



answered Apr 12, 2022 by avibootz

Related questions

1 answer 228 views
1 answer 250 views
1 answer 238 views
1 answer 287 views
1 answer 251 views
2 answers 325 views
2 answers 339 views
...