0

I have an already defined variable,which I want to access using concatenation of two strings to make that variable name.But this treats the later as a string.

list1=[]
if len("list"+str(1))==0:
    print "yes"

Here the length comes out as 5,as it treats list1 as a string,How can I access my previous list1,if I have to generate the variable name dynamically?

Ashish Ranjan
  • 12,760
  • 5
  • 27
  • 51

0 Answers0