Message355126
We're not mind-readers, how do you expect us to know what you tried if you don't tell us?
The walrus operator works for me:
>>> [spam for c in "hello world" if (spam:=c.upper()) in 'AEIOU']
['E', 'O', 'O']
>>> [(spam:=x**2, spam+1) for x in range(5)]
[(0, 1), (1, 2), (4, 5), (9, 10), (16, 17)]
What did you try, and what happened? |
|
Date |
User |
Action |
Args |
2019-10-22 13:03:41 | steven.daprano | set | recipients:
+ steven.daprano, xtreak, EGN |
2019-10-22 13:03:41 | steven.daprano | set | messageid: <1571749421.26.0.051586084569.issue38556@roundup.psfhosted.org> |
2019-10-22 13:03:41 | steven.daprano | link | issue38556 messages |
2019-10-22 13:03:41 | steven.daprano | create | |
|