I'm trying to refactor a code and i see 3 nested loops that can probably change to list comprehensions, but it's trickier than i thought. Can anyone help with this ?
l_ids=["0000000","0000010","0000020","0000030","0000040","0000050","0000060","0000070","0000080","0000090","0000100",
"0000110","0000120","0000130","0000140","0000150"]
l_years=[2018,2019,2020,2021,2022]
l_means=["car","train","plane","other","freight"]
l_id=[]
l_year=[]
l_mean=[]
l_energy=[]
for supp_id in l_ids:
for year in l_years:
for mean in l_means:
l_id.append(supp_id)
l_year.append(year)
l_mean.append(mean)
l_energy.append(random.randint(100000000, 999999999))