I’m trying to accomplish the following:
Iterate a list
if an element (string) does not have a '$' at the first position
apply a '$' and append the new value to the array
I’m trying something like:
symbols = ['aol', 'goog', ...]
(symbols.append('$'+val) if '$' != val[0] for val in symbols)
But I’m getting a syntax error.
Any help is appreciated.
Iterate over a shallow copy of the list and check for
$usingstr.startswith():