我正在尝试完成以下任务:
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
我正在尝试类似的东西:
symbols = ['aol', 'goog', ...]
(symbols.append('$'+val) if '$' != val[0] for val in symbols)
但我收到语法错误。任何帮助表示赞赏。