this is ugly

Probably, you can use iterators instead.  Something like this:
```python
solution = iter(solution)
param = iter(param) # maybe numbered_symbols instead?

for v in var:
    if v in var_t:
        l.append(next(solution))
    else:
        l.append(next(params))
```