[Tutor] Do something on list elements

Valerio Pachera valerio at pbds.eu
Fri Jul 27 08:56:46 EDT 2018


Hi all, I started studying python and I hope you may help me getting better.

Let's start with the first question.
Consider this example

---
#!/usr/bin/python3

l = ['unoX', 'dueX']
c = 0
for n in l:
        l[c] = l[c].replace('X','')
        c = c + 1
print (l)
---

it works but I wonder if there's a better way to achieve the same.





More information about the Tutor mailing list