May-13-2020, 10:52 PM
I'm just an amateur at Python.
I'm reading a book called Python Automation Cookbook. The text contains some numbers to be replaced with X.
The book has this, which works fine:
Is this some new use of a list??
I'm reading a book called Python Automation Cookbook. The text contains some numbers to be replaced with X.
The book has this, which works fine:
redacted = [''.join('X' if w.isdigit() else w for w in word) for word in words]Everything seems to be backward: for loop last, if clause after the condition, yet it does exactly what it should and all the code is in list brackets []
Is this some new use of a list??