i have the following code (this sudo code that reflect the real values in my code)
i have alist :
virt_who_attached_to_std_vdc = ['A', 'B' , 'c' ]
i want to check if an item in that list ,but i want check the list name as the below variable:
vdc_sub = 'std'
sub = 'virt_who_attached_to_'+vdc_sub+'_vdc'
if i am printing the value of "sub" i am getting the same name as the original list ,but this is a string of course:
print(sub)
virt_who_attached_to_std_vdc
so if i will check if 'a' is in sub like this :
if 'A' in sub:
its doesnt print anything ,how do i represent the sub variable as the original virt_who_attached_to_std_vdc list?
What I have tried:
tried to convert sub it to list
sublist = list(sub)
sublist
['v', 'i', 'r', 't', '_', 'w', 'h', 'o', '_', 'a', 't', 't', 'a', 'c', 'h', 'e', 'd', '_', 't', 'o', '_', 's', 't', 'd', '_', 'v', 'd', 'c']