:= is great, it makes the code more compact, for isntance imagine you have a complicated list comprehension and would like to reuse some value in it.,(reply>), @five seven lol, good one! .... perhaps compact code runs faster 🤣,(reply>), ​@Mohammed Salman There are some pretty simple cases where you might want to do this, particularly when you want to guarantee a function is only called once per element. Building a list of random numbers and their squares, for example. [(x:= random(), x*x) for i in range(10)]. Granted you might be better doing: <br>[(x, x*x) for x in map((lambda y: random()), range(10))]<br>or<br>[(x, x*x) for x in [random() for dummy in range(10)]]<br>but I'm not convinced. I like the first most. It's only down side is that a symbol might be defined to the left or to the right of where it is used, but this is only a problem if you start reading in the middle. Otherwise we just meet the definition the first time we meet the symbol.<br>List comprehensions are extremely clear, as long as you keep concerns separate. Beyond basic complexity it should probably be a custom function inside your list comprehension, but writing it as a list compression makes it extremely clear what you are doing: defining a list. When scanning, you see a list, rather than a loop that could be anything. It is not the length of the loop code that is a problem, it is that a loop is much less specific in what it does than a list comprehension, which makes it less clear. A list comprehension might not be particularly clear on how it does what it is supposed to do, but a loop requires detailed inspection to work out what it is even supposed to be doing.,(reply>), @Ekrem Dinçel Yes, that was what I said,(reply>), If you need to assign a variable in list comprehension, just use normal loops,(reply>), just write a for loop then, it's only 1 line longer usually