I have a python list like this:
['photo_1.jpg', 'photo_10.jpg', 'photo_100.jpg' ]
and now I want to remove .jpg
from every element in the list and become
['photo_1', 'photo_10', 'photo_100' ]
I have try
for x in list:
x.replace('.jpg', '')
But it doesn't work. Could anyone help me. Thanks!