mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
From the PEP: an assignment expression occurring in a list, set or dict comprehension or in a generator expression binds the target in the containing scope. GitOrigin-RevId: 88d701a8da298a9b0bdd8c7ac4d4940a5a22f9db
4 lines
107 B
Python
4 lines
107 B
Python
total = 0
|
|
partial_sums = [total := total + v for v in values]
|
|
print("Total:", total)
|
|
<ref> |