If some one can say what does happen with my pycharm, please, explain me my goof)
Why does the list changes after assigning him a value?
The code in comments)
x = ['1.cad', '1.bat', '1.aa', '2.bat']
s = x
print(s)
for el in s:
d = ''
for e in range(len(el)):
if ord(el[e]) in (range(97,123) or range(65,91)):
d+=el[e]
s[s.index(el)] = d
s = sorted(s)
a = []
print(x)
Created at: 2022/03/05 19:02; Updated at: 2022/03/06 12:46