Re:Python idiom for taking the single item from a list
by dirtyaura on Tuesday September 28, 2010 @02:05AM
(#1734744)
There's a better variable naming scheme for generic lists:
Use xs. If you have multiple lists use ys etc.
This has multiple benefits over L in terms of readability anad understandability as a single-item variable names can be made to match the list naming scheme:
for x in xs:
for y in ys:
do_some_fancy_calculation(x,y)
Use xs. If you have multiple lists use ys etc.
This has multiple benefits over L in terms of readability anad understandability as a single-item variable names can be made to match the list naming scheme: