l[i:i+1] in (a, b)

This commit is contained in:
Wannes-Sys 2023-06-20 12:50:14 +00:00
parent 3fa1399880
commit ecac93a02b
1 changed files with 4 additions and 1 deletions

View File

@ -2,6 +2,9 @@ l = [None] * 10
[_ for i,_ in enumerate(temp) for l[i] in [i*5]]
print(l)
# and now with dicts, cause it works too
d = {i:i for i in range(10)}
[_ for i,_ in enumerate(d) for d[i] in [i*5]]
print(d)
print(d)
# sadly sets won't let me :'(