Apr-03-2019, 09:54 AM
iteration through a dictionary and allocate those values to a function for further calculation
i use python 2.7
x={AB,AD,BD} #Dictionary 1
Y={A=1,B=2,C=3,D=4} #Dictionary 2
Ans = {} #Dictionary 3 , for the answers from the function
def add():
i need to use the add function to add the values according to the sequence i have in the dictionary named X.The values of the variables A,B,C,D are stored in another dictionary named Y.
calculate the addition operation and store it in dictionary named Ans.
kindly Help :)
The dictionary named X having the sequence will have infinite sequence. so i do not want it to be manually allocated to the function.
i use python 2.7
x={AB,AD,BD} #Dictionary 1
Y={A=1,B=2,C=3,D=4} #Dictionary 2
Ans = {} #Dictionary 3 , for the answers from the function
def add():
i need to use the add function to add the values according to the sequence i have in the dictionary named X.The values of the variables A,B,C,D are stored in another dictionary named Y.
calculate the addition operation and store it in dictionary named Ans.
kindly Help :)
The dictionary named X having the sequence will have infinite sequence. so i do not want it to be manually allocated to the function.