Light Mode
Dark Mode
Why does the list changes after assigning?

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)

  • assigning
  • bug
  • help
  • list
  • pyCharm
  • python
  • take a hand
Created: March 5, 2022, 7:02 p.m.
Updated: March 6, 2022, 12:46 p.m.
0
10
User avatar
Klimchick