[Solved] Can i include multiple statements when creating a one-line for loop?


You can use a string comprehension:

numbers = [float(p.replace('€','').replace('M','')) for p in a]

which gives:

[110.5, 210.5, 310.5]

solved Can i include multiple statements when creating a one-line for loop?