I have 2 lists where rakam = 1 to 9 sakla_l = sakla,sakla,sakla etc 9 times. I want to join these 2 lists to become sakla0,sakla1,sakla2 etc till sakla9 then I want to declare all as one like
sakla0 =1
sakla1= 1
sakla2= 1 etc..
I am accessing these declarations from below parts of my code now I declared manually but I didn't like to code and I am trying to improve with for loop but no success searched a lot within stackoverflow but I can't find nothing similar to that.Please don't say it's duplicate question because it's not. My aim not to print these items.My aim is to have that declaration of these items equal to 1.
import string
rakam= list(range(10))
sakla_l =["sakla"] * 10
for i in range(10):
j_list=sakla_l[i].join(str(i))
j_list[i] = 1
print(j_list)
My working undesired code is below:
sakla0=1
sakla1=1
sakla2=1
sakla3=1
sakla4=1
sakla5=1
sakla6=1
sakla7=1
sakla8=1
sakla9=1
You might ask why you need to declare, the reason I am hiding some tables or unhiding some tables within the django html template based on these values.