Is there a way to do nested list comprehension?
for example I can square a range of numbers, even only.
[x*x for x in range(1,20) if x % 2==0]
but what if I want to square the even and times the odd by 3.
[x*x for x in range(1,20) if x % 2==0 else x * 3]
, unfortunately that errors. How do I do it?