Hi all, I have a mental block ;-( What is is most efficient way of dong the below? Any ideas are greatly appreciated.
a = b = c = d = ‘’
t = ‘[✓]’
if u == 0:
a = t
if u == 1:
b = t
if u == 2:
c = t
if u == 3:
d = t
Hi all, I have a mental block ;-( What is is most efficient way of dong the below? Any ideas are greatly appreciated.
a = b = c = d = ‘’
t = ‘[✓]’
if u == 0:
a = t
if u == 1:
b = t
if u == 2:
c = t
if u == 3:
d = t
Just for fun:
d = dict.fromkeys('abcd', '<')
c = '>'
u = 2
d[[*enumerate(d)][u][1]] = c
Magic Thanks.