[Solved] How to loop a list and append it to a dictionary in a loop?
I think you are looking for something along the lines of this: # run with python dynamictopo.py z n # e.g.: python dynamictopo.py 3 2 import sys z = int(sys.argv[1]) # number of nodes n = int(sys.argv[2]) # number of hosts nodes = [] for i in range(0, z): nodes.append(“s” + str(i + 1)) print(nodes) … Read more